summaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/MCJIT/MCJIT.h
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-06-10 20:36:52 +0000
committerdim <dim@FreeBSD.org>2013-06-10 20:36:52 +0000
commitaa45f148926e3461a1fd8b10c990f0a51a908cc9 (patch)
tree909310b2e05119d1d6efda049977042abbb58bb1 /lib/ExecutionEngine/MCJIT/MCJIT.h
parent169d2bd06003c39970bc94c99669a34b61bb7e45 (diff)
downloadFreeBSD-src-aa45f148926e3461a1fd8b10c990f0a51a908cc9.zip
FreeBSD-src-aa45f148926e3461a1fd8b10c990f0a51a908cc9.tar.gz
Vendor import of llvm tags/RELEASE_33/final r183502 (effectively, 3.3
release): http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_33/final@183502
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 283a8e5..8c4bf6e 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);
OpenPOWER on IntegriCloud