summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-05-24 21:32:54 +0000
committerAndres Freund <andres@anarazel.de>2018-05-24 21:32:54 +0000
commit4a3e2dc8f97b5061a8ef1343f9d70d76e4c90231 (patch)
tree5e895cb0a918e7db070f5bd47ba08c658c0ec05a
parent7aa54e956e687e42cc96d2e8d7dd398eb2bfd568 (diff)
downloadbcm5719-llvm-4a3e2dc8f97b5061a8ef1343f9d70d76e4c90231.tar.gz
bcm5719-llvm-4a3e2dc8f97b5061a8ef1343f9d70d76e4c90231.zip
[C-API] Add functions to create GDB, Intel, Oprofile event listeners.
The additions of Intel, Oprofile listeners were done blindly. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D44890 llvm-svn: 333230
-rw-r--r--llvm/include/llvm-c/ExecutionEngine.h6
-rw-r--r--llvm/include/llvm/ExecutionEngine/JITEventListener.h12
-rw-r--r--llvm/lib/ExecutionEngine/GDBRegistrationListener.cpp6
-rw-r--r--llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp5
-rw-r--r--llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp5
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());
+}
OpenPOWER on IntegriCloud