summaryrefslogtreecommitdiff
path: root/tools/lli
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2013-10-01 01:47:35 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2013-10-01 01:47:35 +0000
commit8e9ec015348c5419b905c2ca6e39534429eda073 (patch)
treeef91e4612da9faa32322d7f2d4c33d71bc584334 /tools/lli
parent451c71d67b1dd324dcd76d771cf05bf7721bdc59 (diff)
downloadllvm-8e9ec015348c5419b905c2ca6e39534429eda073.tar.gz
llvm-8e9ec015348c5419b905c2ca6e39534429eda073.tar.bz2
llvm-8e9ec015348c5419b905c2ca6e39534429eda073.tar.xz
Adding multiple module support for MCJIT.
Tests to follow. PIC with small code model and EH frame handling will not work with multiple modules. There are also some rough edges to be smoothed out for remote target support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lli')
-rw-r--r--tools/lli/lli.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 8d74b2326d..ba9cb99d5a 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -460,18 +460,18 @@ int main(int argc, char **argv, char * const *envp) {
//
// Run static constructors.
if (!RemoteMCJIT) {
- if (UseMCJIT && !ForceInterpreter) {
- // Give MCJIT a chance to apply relocations and set page permissions.
- EE->finalizeObject();
- }
- EE->runStaticConstructorsDestructors(false);
- }
+ if (UseMCJIT && !ForceInterpreter) {
+ // Give MCJIT a chance to apply relocations and set page permissions.
+ EE->finalizeObject();
+ }
+ EE->runStaticConstructorsDestructors(false);
- if (NoLazyCompilation) {
- for (Module::iterator I = Mod->begin(), E = Mod->end(); I != E; ++I) {
- Function *Fn = &*I;
- if (Fn != EntryFn && !Fn->isDeclaration())
- EE->getPointerToFunction(Fn);
+ if (!UseMCJIT && NoLazyCompilation) {
+ for (Module::iterator I = Mod->begin(), E = Mod->end(); I != E; ++I) {
+ Function *Fn = &*I;
+ if (Fn != EntryFn && !Fn->isDeclaration())
+ EE->getPointerToFunction(Fn);
+ }
}
}
@@ -484,12 +484,10 @@ int main(int argc, char **argv, char * const *envp) {
RemoteTarget Target;
Target.create();
- // Ask for a pointer to the entry function. This triggers the actual
- // compilation.
- (void)EE->getPointerToFunction(EntryFn);
+ // Trigger compilation.
+ EE->generateCodeForModule(Mod);
- // Enough has been compiled to execute the entry function now, so
- // layout the target memory.
+ // Layout the target memory.
layoutRemoteTargetMemory(&Target, MM);
// Since we're executing in a (at least simulated) remote address space,