[llvm-commits] CVS: reopt/lib/TraceJIT/TraceJIT.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Sun Jul 11 19:34:01 PDT 2004


Changes in directory reopt/lib/TraceJIT:

TraceJIT.cpp updated: 1.3 -> 1.4

---
Log message:

Steal some code from lib/ExecutionEngine/JIT/TargetSelect.cpp to mop up after
the death of TargetMachineImpls.h.


---
Diffs of the changes:  (+15 -4)

Index: reopt/lib/TraceJIT/TraceJIT.cpp
diff -u reopt/lib/TraceJIT/TraceJIT.cpp:1.3 reopt/lib/TraceJIT/TraceJIT.cpp:1.4
--- reopt/lib/TraceJIT/TraceJIT.cpp:1.3	Wed Jun 30 01:33:12 2004
+++ reopt/lib/TraceJIT/TraceJIT.cpp	Sun Jul 11 19:33:27 2004
@@ -28,7 +28,7 @@
 #include "llvm/Assembly/PrintModulePass.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetMachineImpls.h"
+#include "llvm/Target/TargetMachineRegistry.h"
 #include "llvm/Target/TargetJITInfo.h"
 #include "Support/CommandLine.h"
 #include "Support/DynamicLinker.h"
@@ -241,12 +241,23 @@
   return Addr;
 }
 
-/// create - Create and return a new SparcV9 TraceJIT compiler, or 0 if
+/// create - Create and return a new TraceJIT compiler, or 0 if
 /// there is an error.
 ///
 TraceJIT *TraceJIT::create(ModuleProvider *MP, IntrinsicLowering *IL) {
-  // Allocate a SparcV9 target.
-  TargetMachine *Target = allocateSparcV9TargetMachine(*MP->getModule(), IL);
+  std::string Error;
+  const TargetMachineRegistry::Entry *ent =
+    TargetMachineRegistry::getClosestTargetForJIT(Error);
+  if (ent == 0) {
+    return 0; 
+  } else if (ent->JITMatchQualityFn() == 0) {
+    std::cerr << "WARNING: This target JIT is not designed for the host you are"
+              << " running.  If bad things happen, please choose a different "
+              << "-march switch.\n";
+  }
+
+  // Allocate a target...
+  TargetMachine *Target = ent->CtorFn(*MP->getModule(), IL);
   assert(Target && "Could not allocate target machine!");
 
   // If the target supports TraceJIT code generation, return a new TraceJIT now.





More information about the llvm-commits mailing list