aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-08-21 15:42:49 +0000
committerJim Grosbach <grosbach@apple.com>2012-08-21 15:42:49 +0000
commit8005bcd5e0c923881d82afcb813a7e537cd1b241 (patch)
treed2e472f1ea1c7e428dc61751379ecca8dd342203 /lib
parent91fcb7f42099f11f8ea298c4b231d801998bf2dd (diff)
downloadexternal_llvm-8005bcd5e0c923881d82afcb813a7e537cd1b241.zip
external_llvm-8005bcd5e0c923881d82afcb813a7e537cd1b241.tar.gz
external_llvm-8005bcd5e0c923881d82afcb813a7e537cd1b241.tar.bz2
MCJIT: Tidy up the constructor.
The MCJIT doesn't need or want a TargetJITInfo. That's vestigal from the old JIT, so just remove it. rdar://12119347 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162280 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp3
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJIT.cpp14
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJIT.h4
3 files changed, 8 insertions, 13 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index a744d0c..4afc900 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -501,7 +501,8 @@ ExecutionEngine *EngineBuilder::create(TargetMachine *TM) {
return 0;
}
- if ((WhichEngine & EngineKind::JIT) && ExecutionEngine::JITCtor == 0) {
+ if ((WhichEngine & EngineKind::JIT) && ExecutionEngine::JITCtor == 0 &&
+ ExecutionEngine::MCJITCtor == 0) {
if (ErrorStr)
*ErrorStr = "JIT has not been linked in.";
}
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index 739ffd7..99c65ec 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -44,18 +44,12 @@ ExecutionEngine *MCJIT::createJIT(Module *M,
// FIXME: Don't do this here.
sys::DynamicLibrary::LoadLibraryPermanently(0, NULL);
- // If the target supports JIT code generation, create the JIT.
- if (TargetJITInfo *TJ = TM->getJITInfo())
- return new MCJIT(M, TM, *TJ, new MCJITMemoryManager(JMM), GVsWithCode);
-
- if (ErrorStr)
- *ErrorStr = "target does not support JIT code generation";
- return 0;
+ return new MCJIT(M, TM, new MCJITMemoryManager(JMM), GVsWithCode);
}
-MCJIT::MCJIT(Module *m, TargetMachine *tm, TargetJITInfo &tji,
- RTDyldMemoryManager *MM, bool AllocateGVsWithCode)
- : ExecutionEngine(m), TM(tm), Ctx(0), MemMgr(MM), Dyld(MM),
+MCJIT::MCJIT(Module *m, TargetMachine *tm, RTDyldMemoryManager *MM,
+ bool AllocateGVsWithCode)
+ : ExecutionEngine(m), TM(tm), Ctx(0), MemMgr(MM), Dyld(MM),
isCompiled(false), M(m), OS(Buffer) {
setTargetData(TM->getTargetData());
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.h b/lib/ExecutionEngine/MCJIT/MCJIT.h
index 1d272e9..138a7b6 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.h
+++ b/lib/ExecutionEngine/MCJIT/MCJIT.h
@@ -23,8 +23,8 @@ namespace llvm {
// blah blah. Purely in get-it-up-and-limping mode for now.
class MCJIT : public ExecutionEngine {
- MCJIT(Module *M, TargetMachine *tm, TargetJITInfo &tji,
- RTDyldMemoryManager *MemMgr, bool AllocateGVsWithCode);
+ MCJIT(Module *M, TargetMachine *tm, RTDyldMemoryManager *MemMgr,
+ bool AllocateGVsWithCode);
TargetMachine *TM;
MCContext *Ctx;