diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lli/CMakeLists.txt | 17 | ||||
-rw-r--r-- | tools/lli/Makefile | 17 | ||||
-rw-r--r-- | tools/lli/lli.cpp | 7 |
3 files changed, 39 insertions, 2 deletions
diff --git a/tools/lli/CMakeLists.txt b/tools/lli/CMakeLists.txt index 9378ef2554..a5d2e61ea2 100644 --- a/tools/lli/CMakeLists.txt +++ b/tools/lli/CMakeLists.txt @@ -1,5 +1,22 @@ + +link_directories( ${LLVM_INTEL_JITEVENTS_LIBDIR} ) + set(LLVM_LINK_COMPONENTS mcjit jit interpreter nativecodegen bitreader asmparser selectiondag) +if( LLVM_USE_OPROFILE ) + set(LLVM_LINK_COMPONENTS + ${LLVM_LINK_COMPONENTS} + OProfileJIT + ) +endif( LLVM_USE_OPROFILE ) + +if( LLVM_USE_INTEL_JITEVENTS ) + set(LLVM_LINK_COMPONENTS + ${LLVM_LINK_COMPONENTS} + IntelJITEvents + ) +endif( LLVM_USE_INTEL_JITEVENTS ) + add_llvm_tool(lli lli.cpp ) diff --git a/tools/lli/Makefile b/tools/lli/Makefile index 292f6087b1..100fc2e415 100644 --- a/tools/lli/Makefile +++ b/tools/lli/Makefile @@ -9,6 +9,21 @@ LEVEL := ../.. TOOLNAME := lli + +include $(LEVEL)/Makefile.config + LINK_COMPONENTS := mcjit jit interpreter nativecodegen bitreader asmparser selectiondag -include $(LEVEL)/Makefile.common +# If Intel JIT Events support is confiured, link against the LLVM Intel JIT +# Events interface library +ifeq ($(USE_INTEL_JITEVENTS), 1) + LINK_COMPONENTS += inteljitevents +endif + +# If oprofile support is confiured, link against the LLVM oprofile interface +# library +ifeq ($(USE_OPROFILE), 1) + LINK_COMPONENTS += oprofilejit +endif + +include $(LLVM_SRC_ROOT)/Makefile.rules diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 0e8d1d8953..efcc1f5870 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -238,7 +238,12 @@ int main(int argc, char **argv, char * const *envp) { exit(1); } - EE->RegisterJITEventListener(createOProfileJITEventListener()); + // The following functions have no effect if their respective profiling + // support wasn't enabled in the build configuration. + EE->RegisterJITEventListener( + JITEventListener::createOProfileJITEventListener()); + EE->RegisterJITEventListener( + JITEventListener::createIntelJITEventListener()); EE->DisableLazyCompilation(NoLazyCompilation); |