diff options
Diffstat (limited to 'llvm')
5 files changed, 34 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/ExecutionEngine.h b/llvm/include/llvm-c/ExecutionEngine.h index 51830fe139c..f109a9879ea 100644 --- a/llvm/include/llvm-c/ExecutionEngine.h +++ b/llvm/include/llvm-c/ExecutionEngine.h @@ -182,6 +182,12 @@ LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManager( void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM); +/*===-- JIT Event Listener functions -------------------------------------===*/ + +LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void); +LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void); +LLVMJITEventListenerRef LLVMCreateOprofileJITEventListener(void); + /** * @} */ diff --git a/llvm/include/llvm/ExecutionEngine/JITEventListener.h b/llvm/include/llvm/ExecutionEngine/JITEventListener.h index bdebf966c9c..7e560abd538 100644 --- a/llvm/include/llvm/ExecutionEngine/JITEventListener.h +++ b/llvm/include/llvm/ExecutionEngine/JITEventListener.h @@ -125,4 +125,16 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(JITEventListener, LLVMJITEventListenerRef) } // end namespace llvm +#ifndef LLVM_USE_INTEL_JITEVENTS +LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void) { + return nullptr; +} +#endif + +#ifndef LLVM_USE_OPROFILE +LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void) { + return nullptr; +} +#endif + #endif // LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H diff --git a/llvm/lib/ExecutionEngine/GDBRegistrationListener.cpp b/llvm/lib/ExecutionEngine/GDBRegistrationListener.cpp index dad099d73c9..fd4f0746f7f 100644 --- a/llvm/lib/ExecutionEngine/GDBRegistrationListener.cpp +++ b/llvm/lib/ExecutionEngine/GDBRegistrationListener.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm-c/ExecutionEngine.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ExecutionEngine/JITEventListener.h" #include "llvm/Object/ObjectFile.h" @@ -235,3 +236,8 @@ JITEventListener* JITEventListener::createGDBRegistrationListener() { } } // namespace llvm + +LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void) +{ + return wrap(JITEventListener::createGDBRegistrationListener()); +} diff --git a/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp b/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp index cb6dd5e5728..a9b9a63da5a 100644 --- a/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp +++ b/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "IntelJITEventsWrapper.h" +#include "llvm-c/ExecutionEngine.h" #include "llvm/ADT/DenseMap.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/Config/config.h" @@ -238,3 +239,7 @@ JITEventListener *JITEventListener::createIntelJITEventListener( } // namespace llvm +LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void) +{ + return wrap(JITEventListener::createIntelJITEventListener()); +} diff --git a/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp b/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp index 29d9d080fc5..1cdd1e3d743 100644 --- a/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp +++ b/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp @@ -12,6 +12,7 @@ // //===----------------------------------------------------------------------===// +#include "llvm-c/ExecutionEngine.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/Config/config.h" #include "llvm/ExecutionEngine/JITEventListener.h" @@ -158,3 +159,7 @@ JITEventListener *JITEventListener::createOProfileJITEventListener() { } // namespace llvm +LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void) +{ + return wrap(JITEventListener::createOProfileJITEventListener()); +} |