diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2012-11-06 18:51:59 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2012-11-06 18:51:59 +0000 |
commit | 776054dd938472828ac3ebf75b05e21171ef4ecf (patch) | |
tree | 33b22b5999bf7b136ad7b72a1b2259aa7e9b471d /lib/ExecutionEngine/MCJIT/MCJIT.h | |
parent | 64afe13a2090d34e25d197862f4c3f54fcea6397 (diff) |
Add interface for object-based JIT events.
This patch adds the interface to expose events from MCJIT when an object is emitted or freed and implements the MCJIT functionality to send those events. The IntelJITEventListener implementation is left empty for now. It will be fleshed out in a future patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT/MCJIT.h')
-rw-r--r-- | lib/ExecutionEngine/MCJIT/MCJIT.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.h b/lib/ExecutionEngine/MCJIT/MCJIT.h index 6cffcc5b82..571080d2bd 100644 --- a/lib/ExecutionEngine/MCJIT/MCJIT.h +++ b/lib/ExecutionEngine/MCJIT/MCJIT.h @@ -11,6 +11,7 @@ #define LLVM_LIB_EXECUTIONENGINE_MCJIT_H #include "llvm/PassManager.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/RuntimeDyld.h" @@ -30,6 +31,7 @@ class MCJIT : public ExecutionEngine { MCContext *Ctx; RTDyldMemoryManager *MemMgr; RuntimeDyld Dyld; + SmallVector<JITEventListener*, 2> EventListeners; // FIXME: Add support for multiple modules bool isCompiled; @@ -75,6 +77,9 @@ public: Dyld.mapSectionAddress(LocalAddress, TargetAddress); } + virtual void RegisterJITEventListener(JITEventListener *L); + virtual void UnregisterJITEventListener(JITEventListener *L); + /// @} /// @name (Private) Registration Interfaces /// @{ @@ -98,6 +103,9 @@ protected: /// is passed as a parameter here to prepare for multiple module support in /// the future. void emitObject(Module *M); + + void NotifyObjectEmitted(const ObjectImage& Obj); + void NotifyFreeingObject(const ObjectImage& Obj); }; } // End llvm namespace |