diff options
Diffstat (limited to 'src/compiler_llvm/compiler_llvm.cc')
| -rw-r--r-- | src/compiler_llvm/compiler_llvm.cc | 9 |
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(); } |