summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/compiler_llvm.cc
diff options
context:
space:
mode:
author Logan Chien <loganchien@google.com> 2012-03-02 17:20:33 +0800
committer Shih-wei Liao <sliao@google.com> 2012-03-02 01:41:30 -0800
commit013b6f296ff7c0cb6aa5aeb6868df05995eeadb7 (patch)
tree6ea7d86b3b79d8562fc50566ac392f3572a971e2 /src/compiler_llvm/compiler_llvm.cc
parent6d6d754c5500e29e5e6ec6b3404725535b794e1e (diff)
Print LLVM passes time consumption.
Change-Id: I592b843da83acefb5b397e07565406254081d3df
Diffstat (limited to 'src/compiler_llvm/compiler_llvm.cc')
-rw-r--r--src/compiler_llvm/compiler_llvm.cc9
1 files changed, 9 insertions, 0 deletions
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 <llvm/LinkAllPasses.h>
#include <llvm/LinkAllVMCore.h>
+#include <llvm/Support/ManagedStatic.h>
#include <llvm/Support/TargetSelect.h>
#include <llvm/Support/Threading.h>
+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();
}