forked from OSchip/llvm-project
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 llvm-svn: 162280
This commit is contained in:
parent
68d9c9da40
commit
bea6753f4f
|
@ -501,7 +501,8 @@ ExecutionEngine *EngineBuilder::create(TargetMachine *TM) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((WhichEngine & EngineKind::JIT) && ExecutionEngine::JITCtor == 0) {
|
if ((WhichEngine & EngineKind::JIT) && ExecutionEngine::JITCtor == 0 &&
|
||||||
|
ExecutionEngine::MCJITCtor == 0) {
|
||||||
if (ErrorStr)
|
if (ErrorStr)
|
||||||
*ErrorStr = "JIT has not been linked in.";
|
*ErrorStr = "JIT has not been linked in.";
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,18 +44,12 @@ ExecutionEngine *MCJIT::createJIT(Module *M,
|
||||||
// FIXME: Don't do this here.
|
// FIXME: Don't do this here.
|
||||||
sys::DynamicLibrary::LoadLibraryPermanently(0, NULL);
|
sys::DynamicLibrary::LoadLibraryPermanently(0, NULL);
|
||||||
|
|
||||||
// If the target supports JIT code generation, create the JIT.
|
return new MCJIT(M, TM, new MCJITMemoryManager(JMM), GVsWithCode);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MCJIT::MCJIT(Module *m, TargetMachine *tm, TargetJITInfo &tji,
|
MCJIT::MCJIT(Module *m, TargetMachine *tm, RTDyldMemoryManager *MM,
|
||||||
RTDyldMemoryManager *MM, bool AllocateGVsWithCode)
|
bool AllocateGVsWithCode)
|
||||||
: ExecutionEngine(m), TM(tm), Ctx(0), MemMgr(MM), Dyld(MM),
|
: ExecutionEngine(m), TM(tm), Ctx(0), MemMgr(MM), Dyld(MM),
|
||||||
isCompiled(false), M(m), OS(Buffer) {
|
isCompiled(false), M(m), OS(Buffer) {
|
||||||
|
|
||||||
setTargetData(TM->getTargetData());
|
setTargetData(TM->getTargetData());
|
||||||
|
|
|
@ -23,8 +23,8 @@ namespace llvm {
|
||||||
// blah blah. Purely in get-it-up-and-limping mode for now.
|
// blah blah. Purely in get-it-up-and-limping mode for now.
|
||||||
|
|
||||||
class MCJIT : public ExecutionEngine {
|
class MCJIT : public ExecutionEngine {
|
||||||
MCJIT(Module *M, TargetMachine *tm, TargetJITInfo &tji,
|
MCJIT(Module *M, TargetMachine *tm, RTDyldMemoryManager *MemMgr,
|
||||||
RTDyldMemoryManager *MemMgr, bool AllocateGVsWithCode);
|
bool AllocateGVsWithCode);
|
||||||
|
|
||||||
TargetMachine *TM;
|
TargetMachine *TM;
|
||||||
MCContext *Ctx;
|
MCContext *Ctx;
|
||||||
|
|
Loading…
Reference in New Issue