[PATCH] D49654: Move JIT listener C binding definitions to ExecutionEngineBindings.cpp.
Andres Freund via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 22 20:05:51 PDT 2018
anarazel created this revision.
anarazel added reviewers: krasimir, lhames.
Herald added a subscriber: llvm-commits.
Initially, in https://reviews.llvm.org/D44890, I had these defined as
empty functions 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 function definition unconditionally to
ExecutionEngineBindings.cpp. That solves both problems. No ifdefs
needed, the ones in JITEventListener are sufficient.
Repository:
rL LLVM
https://reviews.llvm.org/D49654
Files:
lib/ExecutionEngine/ExecutionEngineBindings.cpp
lib/ExecutionEngine/GDBRegistrationListener.cpp
lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
Index: lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
===================================================================
--- lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
+++ lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp
@@ -182,8 +182,3 @@
}
} // namespace llvm
-
-LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void)
-{
- return wrap(JITEventListener::createOProfileJITEventListener());
-}
Index: lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
===================================================================
--- lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
+++ lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp
@@ -240,8 +240,3 @@
}
} // namespace llvm
-
-LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void)
-{
- return wrap(JITEventListener::createIntelJITEventListener());
-}
Index: lib/ExecutionEngine/GDBRegistrationListener.cpp
===================================================================
--- lib/ExecutionEngine/GDBRegistrationListener.cpp
+++ lib/ExecutionEngine/GDBRegistrationListener.cpp
@@ -236,8 +236,3 @@
}
} // namespace llvm
-
-LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void)
-{
- return wrap(JITEventListener::createGDBRegistrationListener());
-}
Index: lib/ExecutionEngine/ExecutionEngineBindings.cpp
===================================================================
--- lib/ExecutionEngine/ExecutionEngineBindings.cpp
+++ lib/ExecutionEngine/ExecutionEngineBindings.cpp
@@ -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,19 @@
delete unwrap(MM);
}
+/*===-- JIT Event Listener functions -------------------------------------===*/
+
+LLVMJITEventListenerRef LLVMCreateGDBRegistrationListener(void)
+{
+ return wrap(JITEventListener::createGDBRegistrationListener());
+}
+
+LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void)
+{
+ return wrap(JITEventListener::createIntelJITEventListener());
+}
+
+LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void)
+{
+ return wrap(JITEventListener::createOProfileJITEventListener());
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49654.156718.patch
Type: text/x-patch
Size: 2414 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180723/cb67b3f7/attachment.bin>
More information about the llvm-commits
mailing list