]> granicus.if.org Git - llvm/commitdiff
Move JIT listener C binding fallbackks to ExecutionEngineBindings.cpp.
authorAndres Freund <andres@anarazel.de>
Wed, 25 Jul 2018 15:04:57 +0000 (15:04 +0000)
committerAndres Freund <andres@anarazel.de>
Wed, 25 Jul 2018 15:04:57 +0000 (15:04 +0000)
Initially, in https://reviews.llvm.org/D44890, I had these defined as
empty functions inside the header when the respective event listener
was not built in. As done in that commit, that wasn't correct, because
it was a ODR violation.  Krasimir hot-fixed that in r333265, but that
wasn't quite right either, because it'd lead to the symbol not being
available.

Instead just move the fallbacksto ExecutionEngineBindings.cpp. Could
define them as static inlines in the header too, but I don't think it
matters.

Reviewers: whitequark

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D49654

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337930 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ExecutionEngine/JITEventListener.h
lib/ExecutionEngine/ExecutionEngineBindings.cpp

index 195132aa22752018c31d1ef6456e3ae584f81653..1ce772ccde956fc82fcdecab3996c77040d61908 100644 (file)
@@ -134,16 +134,4 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(JITEventListener, LLVMJITEventListenerRef)
 
 } // end namespace llvm
 
-#ifndef LLVM_USE_INTEL_JITEVENTS
-LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void);
-#endif
-
-#ifndef LLVM_USE_OPROFILE
-LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void);
-#endif
-
-#ifndef LLVM_USE_PERF
-LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void);
-#endif
-
 #endif // LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H
index 295476cb91a913da63ab69b8753b8fff12c332d6..abcdaeba8eb060b7512bbab153864fc4a34ee0b9 100644 (file)
@@ -14,6 +14,7 @@
 #include "llvm-c/ExecutionEngine.h"
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
 #include "llvm/ExecutionEngine/GenericValue.h"
+#include "llvm/ExecutionEngine/JITEventListener.h"
 #include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Module.h"
@@ -411,3 +412,26 @@ void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM) {
   delete unwrap(MM);
 }
 
+/*===-- JIT Event Listener functions -------------------------------------===*/
+
+
+#if !LLVM_USE_INTEL_JITEVENTS
+LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void)
+{
+  return nullptr;
+}
+#endif
+
+#if !LLVM_USE_OPROFILE
+LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void)
+{
+  return nullptr;
+}
+#endif
+
+#if !LLVM_USE_PERF
+LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void)
+{
+  return nullptr;
+}
+#endif