Skip to content

Commit ee10ce7

Browse files
committed
Move JIT listener C binding fallbackks to ExecutionEngineBindings.cpp.
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 llvm-svn: 337930
1 parent 63c153e commit ee10ce7

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

llvm/include/llvm/ExecutionEngine/JITEventListener.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,4 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(JITEventListener, LLVMJITEventListenerRef)
134134

135135
} // end namespace llvm
136136

137-
#ifndef LLVM_USE_INTEL_JITEVENTS
138-
LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void);
139-
#endif
140-
141-
#ifndef LLVM_USE_OPROFILE
142-
LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void);
143-
#endif
144-
145-
#ifndef LLVM_USE_PERF
146-
LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void);
147-
#endif
148-
149137
#endif // LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H

llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "llvm-c/ExecutionEngine.h"
1515
#include "llvm/ExecutionEngine/ExecutionEngine.h"
1616
#include "llvm/ExecutionEngine/GenericValue.h"
17+
#include "llvm/ExecutionEngine/JITEventListener.h"
1718
#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
1819
#include "llvm/IR/DerivedTypes.h"
1920
#include "llvm/IR/Module.h"
@@ -411,3 +412,26 @@ void LLVMDisposeMCJITMemoryManager(LLVMMCJITMemoryManagerRef MM) {
411412
delete unwrap(MM);
412413
}
413414

415+
/*===-- JIT Event Listener functions -------------------------------------===*/
416+
417+
418+
#if !LLVM_USE_INTEL_JITEVENTS
419+
LLVMJITEventListenerRef LLVMCreateIntelJITEventListener(void)
420+
{
421+
return nullptr;
422+
}
423+
#endif
424+
425+
#if !LLVM_USE_OPROFILE
426+
LLVMJITEventListenerRef LLVMCreateOProfileJITEventListener(void)
427+
{
428+
return nullptr;
429+
}
430+
#endif
431+
432+
#if !LLVM_USE_PERF
433+
LLVMJITEventListenerRef LLVMCreatePerfJITEventListener(void)
434+
{
435+
return nullptr;
436+
}
437+
#endif

0 commit comments

Comments
 (0)