diff options
author | Chris Lattner <sabre@nondot.org> | 2003-12-20 01:22:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-12-20 01:22:19 +0000 |
commit | 1e60a9165dc4d6ce5650dacc026f2942696af920 (patch) | |
tree | 6af93d79e843f6f224f31d291f0b7a7aca81e7b8 /lib/ExecutionEngine/JIT/JIT.cpp | |
parent | 370e809107c5baf5671daa8709e7d981c0a89685 (diff) |
Rip JIT specific stuff out of TargetMachine, as per PR176
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10542 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/JIT.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index c5a70eade5..dc9f7a14ff 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -80,19 +80,20 @@ ExecutionEngine *VM::create(ModuleProvider *MP) { // Allocate a target... TargetMachine *Target = TargetMachineAllocator(*MP->getModule()); assert(Target && "Could not allocate target machine!"); - - // Create the virtual machine object... - return new VM(MP, Target); + + // If the target supports JIT code generation, return a new JIT now. + if (TargetJITInfo *TJ = Target->getJITInfo()) + return new VM(MP, *Target, *TJ); + return 0; } -VM::VM(ModuleProvider *MP, TargetMachine *tm) : ExecutionEngine(MP), TM(*tm), - PM(MP) -{ +VM::VM(ModuleProvider *MP, TargetMachine &tm, TargetJITInfo &tji) + : ExecutionEngine(MP), TM(tm), TJI(tji), PM(MP) { setTargetData(TM.getTargetData()); // Initialize MCE MCE = createEmitter(*this); - + setupPassManager(); emitGlobals(); |