Add a JITEventListener interface that gets called back when a new function is

emitted or the machine code for a function is freed.  Chris mentioned that we
may also want a notification when a stub is emitted, but that'll be a future
change.  I intend to use this to tell oprofile where functions are emitted and
what lines correspond to what addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74157 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jeffrey Yasskin
2009-06-25 02:04:04 +00:00
parent b6c29d5512
commit df5a7daff9
11 changed files with 602 additions and 172 deletions

View File

@ -29,13 +29,14 @@ class Constant;
class Function;
class GlobalVariable;
class GlobalValue;
class Module;
class ModuleProvider;
class TargetData;
class Type;
class MutexGuard;
class JITEventListener;
class JITMemoryManager;
class MachineCodeInfo;
class Module;
class ModuleProvider;
class MutexGuard;
class TargetData;
class Type;
class ExecutionEngineState {
private:
@ -276,7 +277,14 @@ public:
virtual void *getOrEmitGlobalVariable(const GlobalVariable *GV) {
return getPointerToGlobal((GlobalValue*)GV);
}
/// Registers a listener to be called back on various events within
/// the JIT. See JITEventListener.h for more details. Does not
/// take ownership of the argument. The argument may be NULL, in
/// which case these functions do nothing.
virtual void RegisterJITEventListener(JITEventListener *L) {}
virtual void UnregisterJITEventListener(JITEventListener *L) {}
/// DisableLazyCompilation - If called, the JIT will abort if lazy compilation
/// is ever attempted.
void DisableLazyCompilation(bool Disabled = true) {