From 013b6f296ff7c0cb6aa5aeb6868df05995eeadb7 Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Fri, 2 Mar 2012 17:20:33 +0800 Subject: Print LLVM passes time consumption. Change-Id: I592b843da83acefb5b397e07565406254081d3df --- src/compiler_llvm/compiler_llvm.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/compiler_llvm/compiler_llvm.cc') diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc index 1edbd46df2..c94e7ea36d 100644 --- a/src/compiler_llvm/compiler_llvm.cc +++ b/src/compiler_llvm/compiler_llvm.cc @@ -27,15 +27,23 @@ #include #include +#include #include #include +namespace llvm { + extern bool TimePassesIsEnabled; +} + namespace { pthread_once_t llvm_initialized = PTHREAD_ONCE_INIT; void InitializeLLVM() { + // NOTE: Uncomment following line to show the time consumption of LLVM passes + //llvm::TimePassesIsEnabled = true; + // Initialize LLVM target, MC subsystem, asm printer, and asm parser llvm::InitializeAllTargets(); llvm::InitializeAllTargetMCs(); @@ -81,6 +89,7 @@ CompilerLLVM::CompilerLLVM(Compiler* compiler, InstructionSet insn_set) CompilerLLVM::~CompilerLLVM() { STLDeleteElements(&cunits_); + llvm::llvm_shutdown(); } -- cgit v1.2.3-59-g8ed1b