summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/MCJIT/MCJIT.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-06-10 20:36:52 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-06-10 20:36:52 +0000
commit59d6cff90eecf31cb3dd860c4e786674cfdd42eb (patch)
tree909310b2e05119d1d6efda049977042abbb58bb1 /lib/ExecutionEngine/MCJIT/MCJIT.h
parent4a16efa3e43e35f0cc9efe3a67f620f0017c3d36 (diff)
Notes
Diffstat (limited to 'lib/ExecutionEngine/MCJIT/MCJIT.h')
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJIT.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.h b/lib/ExecutionEngine/MCJIT/MCJIT.h
index 283a8e528118f..8c4bf6e1dbc7d 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.h
+++ b/lib/ExecutionEngine/MCJIT/MCJIT.h
@@ -12,6 +12,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
+#include "llvm/ExecutionEngine/ObjectCache.h"
#include "llvm/ExecutionEngine/RuntimeDyld.h"
#include "llvm/PassManager.h"
@@ -34,16 +35,23 @@ class MCJIT : public ExecutionEngine {
SmallVector<JITEventListener*, 2> EventListeners;
// FIXME: Add support for multiple modules
- bool isCompiled;
+ bool IsLoaded;
Module *M;
OwningPtr<ObjectImage> LoadedObject;
+ // An optional ObjectCache to be notified of compiled objects and used to
+ // perform lookup of pre-compiled code to avoid re-compilation.
+ ObjectCache *ObjCache;
+
public:
~MCJIT();
/// @name ExecutionEngine interface implementation
/// @{
+ /// Sets the object manager that MCJIT should use to avoid compilation.
+ virtual void setObjectCache(ObjectCache *manager);
+
virtual void finalizeObject();
virtual void *getPointerToBasicBlock(BasicBlock *BB);
@@ -102,7 +110,9 @@ protected:
/// this function call is expected to be the contained module. The module
/// is passed as a parameter here to prepare for multiple module support in
/// the future.
- void emitObject(Module *M);
+ ObjectBufferStream* emitObject(Module *M);
+
+ void loadObject(Module *M);
void NotifyObjectEmitted(const ObjectImage& Obj);
void NotifyFreeingObject(const ObjectImage& Obj);