[llvm] r333229 - [ORC][C-API] Expose LLVMOrc{Unr, R}egisterJITEventListener().
Andres Freund via llvm-commits
llvm-commits at lists.llvm.org
Thu May 24 14:32:52 PDT 2018
Author: anarazel
Date: Thu May 24 14:32:52 2018
New Revision: 333229
URL: http://llvm.org/viewvc/llvm-project?rev=333229&view=rev
Log:
[ORC][C-API] Expose LLVMOrc{Unr,R}egisterJITEventListener().
Reviewed By: lhames
Differential Revision: https://reviews.llvm.org/D44890
Modified:
llvm/trunk/include/llvm-c/OrcBindings.h
llvm/trunk/include/llvm-c/Types.h
llvm/trunk/include/llvm/ExecutionEngine/JITEventListener.h
llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindings.cpp
Modified: llvm/trunk/include/llvm-c/OrcBindings.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/OrcBindings.h?rev=333229&r1=333228&r2=333229&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/OrcBindings.h (original)
+++ llvm/trunk/include/llvm-c/OrcBindings.h Thu May 24 14:32:52 2018
@@ -154,6 +154,20 @@ LLVMOrcErrorCode LLVMOrcGetSymbolAddress
*/
LLVMOrcErrorCode LLVMOrcDisposeInstance(LLVMOrcJITStackRef JITStack);
+/**
+ * Register a JIT Event Listener.
+ *
+ * A NULL listener is ignored.
+ */
+void LLVMOrcRegisterJITEventListener(LLVMOrcJITStackRef JITStack, LLVMJITEventListenerRef L);
+
+/**
+ * Unegister a JIT Event Listener.
+ *
+ * A NULL listener is ignored.
+ */
+void LLVMOrcUnregisterJITEventListener(LLVMOrcJITStackRef JITStack, LLVMJITEventListenerRef L);
+
#ifdef __cplusplus
}
#endif /* extern "C" */
Modified: llvm/trunk/include/llvm-c/Types.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Types.h?rev=333229&r1=333228&r2=333229&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Types.h (original)
+++ llvm/trunk/include/llvm-c/Types.h Thu May 24 14:32:52 2018
@@ -145,6 +145,11 @@ typedef struct LLVMComdat *LLVMComdatRef
typedef struct LLVMOpaqueModuleFlagEntry LLVMModuleFlagEntry;
/**
+ * @see llvm::JITEventListener
+ */
+typedef struct LLVMOpaqueJITEventListener *LLVMJITEventListenerRef;
+
+/**
* @}
*/
Modified: llvm/trunk/include/llvm/ExecutionEngine/JITEventListener.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/JITEventListener.h?rev=333229&r1=333228&r2=333229&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/JITEventListener.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/JITEventListener.h Thu May 24 14:32:52 2018
@@ -15,9 +15,11 @@
#ifndef LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H
#define LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H
+#include "llvm-c/ExecutionEngine.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/ExecutionEngine/RuntimeDyld.h"
#include "llvm/IR/DebugLoc.h"
+#include "llvm/Support/CBindingWrapping.h"
#include <cstdint>
#include <vector>
@@ -119,6 +121,8 @@ private:
virtual void anchor();
};
+DEFINE_SIMPLE_CONVERSION_FUNCTIONS(JITEventListener, LLVMJITEventListenerRef)
+
} // end namespace llvm
#endif // LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H
Modified: llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindings.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindings.cpp?rev=333229&r1=333228&r2=333229&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindings.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/Orc/OrcCBindings.cpp Thu May 24 14:32:52 2018
@@ -9,6 +9,7 @@
#include "OrcCBindingsStack.h"
#include "llvm-c/OrcBindings.h"
+#include "llvm/ExecutionEngine/JITEventListener.h"
using namespace llvm;
@@ -126,3 +127,13 @@ LLVMOrcErrorCode LLVMOrcDisposeInstance(
delete J;
return Err;
}
+
+void LLVMOrcRegisterJITEventListener(LLVMOrcJITStackRef JITStack, LLVMJITEventListenerRef L)
+{
+ unwrap(JITStack)->RegisterJITEventListener(unwrap(L));
+}
+
+void LLVMOrcUnregisterJITEventListener(LLVMOrcJITStackRef JITStack, LLVMJITEventListenerRef L)
+{
+ unwrap(JITStack)->UnregisterJITEventListener(unwrap(L));
+}
More information about the llvm-commits
mailing list