File indexing completed on 2026-05-10 08:43:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H
0015 #define LLVM_EXECUTIONENGINE_JITEVENTLISTENER_H
0016
0017 #include "llvm-c/ExecutionEngine.h"
0018 #include "llvm/Config/llvm-config.h"
0019 #include "llvm/ExecutionEngine/RuntimeDyld.h"
0020 #include "llvm/IR/DebugLoc.h"
0021 #include "llvm/Support/CBindingWrapping.h"
0022 #include <cstdint>
0023
0024 namespace llvm {
0025
0026 class IntelJITEventsWrapper;
0027 class OProfileWrapper;
0028
0029 namespace object {
0030
0031 class ObjectFile;
0032
0033 }
0034
0035
0036
0037
0038
0039
0040 class JITEventListener {
0041 public:
0042 using ObjectKey = uint64_t;
0043
0044 JITEventListener() = default;
0045 virtual ~JITEventListener() = default;
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056 virtual void notifyObjectLoaded(ObjectKey K, const object::ObjectFile &Obj,
0057 const RuntimeDyld::LoadedObjectInfo &L) {}
0058
0059
0060
0061 virtual void notifyFreeingObject(ObjectKey K) {}
0062
0063
0064 static JITEventListener *createGDBRegistrationListener();
0065
0066 #if LLVM_USE_INTEL_JITEVENTS
0067
0068 static JITEventListener *createIntelJITEventListener();
0069
0070
0071 static JITEventListener *createIntelJITEventListener(
0072 IntelJITEventsWrapper* AlternativeImpl);
0073 #else
0074 static JITEventListener *createIntelJITEventListener() { return nullptr; }
0075
0076 static JITEventListener *createIntelJITEventListener(
0077 IntelJITEventsWrapper* AlternativeImpl) {
0078 return nullptr;
0079 }
0080 #endif
0081
0082 #if LLVM_USE_OPROFILE
0083
0084 static JITEventListener *createOProfileJITEventListener();
0085
0086
0087 static JITEventListener *createOProfileJITEventListener(
0088 OProfileWrapper* AlternativeImpl);
0089 #else
0090 static JITEventListener *createOProfileJITEventListener() { return nullptr; }
0091
0092 static JITEventListener *createOProfileJITEventListener(
0093 OProfileWrapper* AlternativeImpl) {
0094 return nullptr;
0095 }
0096 #endif
0097
0098 #if LLVM_USE_PERF
0099 static JITEventListener *createPerfJITEventListener();
0100 #else
0101 static JITEventListener *createPerfJITEventListener()
0102 {
0103 return nullptr;
0104 }
0105 #endif
0106
0107 private:
0108 virtual void anchor();
0109 };
0110
0111 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(JITEventListener, LLVMJITEventListenerRef)
0112
0113 }
0114
0115 #endif