Add EngineBuilder to ExecutionEngine in favor of the five optional argument EE::create().
[oota-llvm.git] / lib / ExecutionEngine / JIT / TargetSelect.cpp
index 598b867a3f942967c6a83228eb427e8f00410033..2b80e7e2bd16d36d6eb14041c7e6cb45acf01ef2 100644 (file)
@@ -38,13 +38,9 @@ MAttrs("mattr",
   cl::desc("Target specific attributes (-mattr=help for details)"),
   cl::value_desc("a1,+a2,-a3,..."));
 
   cl::desc("Target specific attributes (-mattr=help for details)"),
   cl::value_desc("a1,+a2,-a3,..."));
 
-/// createInternal - Create an return a new JIT compiler if there is one
-/// available for the current target.  Otherwise, return null.
-///
-ExecutionEngine *JIT::createJIT(ModuleProvider *MP, std::string *ErrorStr,
-                                JITMemoryManager *JMM,
-                                CodeGenOpt::Level OptLevel,
-                                bool AllocateGVsWithCode) {
+/// selectTarget - Pick a target either via -march or by guessing the native
+/// arch.  Add any CPU features specified via -mcpu or -mattr.
+TargetMachine *JIT::selectTarget(ModuleProvider *MP, std::string *ErrorStr) {
   const Target *TheTarget = 0;
   if (MArch.empty()) {
     std::string Error;
   const Target *TheTarget = 0;
   if (MArch.empty()) {
     std::string Error;
@@ -90,12 +86,5 @@ ExecutionEngine *JIT::createJIT(ModuleProvider *MP, std::string *ErrorStr,
   TargetMachine *Target = 
     TheTarget->createTargetMachine(*MP->getModule(), FeaturesStr);
   assert(Target && "Could not allocate target machine!");
   TargetMachine *Target = 
     TheTarget->createTargetMachine(*MP->getModule(), FeaturesStr);
   assert(Target && "Could not allocate target machine!");
-
-  // If the target supports JIT code generation, return a new JIT now.
-  if (TargetJITInfo *TJ = Target->getJITInfo())
-    return new JIT(MP, *Target, *TJ, JMM, OptLevel, AllocateGVsWithCode);
-
-  if (ErrorStr)
-    *ErrorStr = "target does not support JIT code generation";
-  return 0;
+  return Target;
 }
 }