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
diff --git a/lib/ExecutionEngine/JIT/VM.cpp b/lib/ExecutionEngine/JIT/VM.cpp
index 29ffa30..5dffa5c 100644
--- a/lib/ExecutionEngine/JIT/VM.cpp
+++ b/lib/ExecutionEngine/JIT/VM.cpp
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/MachineCodeEmitter.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/Target/TargetMachine.h"
+#include "llvm/Target/TargetJITInfo.h"
 using namespace llvm;
 
 VM::~VM() {
@@ -30,11 +31,7 @@
 ///
 void VM::setupPassManager() {
   // Compile LLVM Code down to machine code in the intermediate representation
-  if (TM.addPassesToJITCompile(PM)) {
-    std::cerr << "lli: target '" << TM.getName()
-              << "' doesn't support JIT compilation!\n";
-    abort();
-  }
+  TJI.addPassesToJITCompile(PM);
 
   // Turn the machine code intermediate representation into bytes in memory that
   // may be executed.
@@ -87,7 +84,7 @@
   if (I != GlobalAddress.end()) return I->second;
 
   // If the target supports "stubs" for functions, get a stub now.
-  if (void *Ptr = TM.getJITStubForFunction(F, *MCE))
+  if (void *Ptr = TJI.getJITStubForFunction(F, *MCE))
     return Ptr;
 
   // Otherwise, if the target doesn't support it, just codegen the function.
@@ -112,6 +109,6 @@
   MachineFunction::destruct(F);
   runJITOnFunction(F);
   assert(Addr && "Code generation didn't add function to GlobalAddress table!");
-  TM.replaceMachineCodeForFunction(OldAddr, Addr);
+  TJI.replaceMachineCodeForFunction(OldAddr, Addr);
   return Addr;
 }