summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/MCJIT/MCJIT.h
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-01-08 04:09:09 +0000
committerLang Hames <lhames@gmail.com>2014-01-08 04:09:09 +0000
commit42fdb1f00ffc5d0a0326f11cadaeec1c26691688 (patch)
tree5294abeb5fb8c95d81ced305ed1a9d5d0ba7849b /lib/ExecutionEngine/MCJIT/MCJIT.h
parent0fe78d5669e37cf9c5b613ef56b4e5a2de975271 (diff)
downloadllvm-42fdb1f00ffc5d0a0326f11cadaeec1c26691688.tar.gz
llvm-42fdb1f00ffc5d0a0326f11cadaeec1c26691688.tar.bz2
llvm-42fdb1f00ffc5d0a0326f11cadaeec1c26691688.tar.xz
Re-apply r196639: Add support for archives and object file caching under MCJIT.
I believe the bot failures on linux systems were due to overestimating the alignment of object-files within archives, which are only guaranteed to be two-byte aligned. I have reduced the alignment in RuntimeDyldELF::createObjectImageFromFile accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/MCJIT/MCJIT.h')
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJIT.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.h b/lib/ExecutionEngine/MCJIT/MCJIT.h
index 58381c3c34..44fd6bce47 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.h
+++ b/lib/ExecutionEngine/MCJIT/MCJIT.h
@@ -206,8 +206,10 @@ class MCJIT : public ExecutionEngine {
OwningModuleContainer OwnedModules;
- typedef DenseMap<Module *, ObjectImage *> LoadedObjectMap;
- LoadedObjectMap LoadedObjects;
+ SmallVector<object::Archive*, 2> Archives;
+
+ typedef SmallVector<ObjectImage *, 2> LoadedObjectList;
+ LoadedObjectList LoadedObjects;
// An optional ObjectCache to be notified of compiled objects and used to
// perform lookup of pre-compiled code to avoid re-compilation.
@@ -227,6 +229,8 @@ public:
/// @name ExecutionEngine interface implementation
/// @{
virtual void addModule(Module *M);
+ virtual void addObjectFile(object::ObjectFile *O);
+ virtual void addArchive(object::Archive *O);
virtual bool removeModule(Module *M);
/// FindFunctionNamed - Search all of the active modules to find the one that