diff options
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
| -rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 51 | 
1 files changed, 12 insertions, 39 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 11e9685..2b1e878 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -29,7 +29,6 @@  #include "llvm/Support/DynamicLibrary.h"  #include "llvm/Support/Host.h"  #include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetMachine.h"  #include <cmath>  #include <cstring>  using namespace llvm; @@ -43,14 +42,20 @@ ExecutionEngine *(*ExecutionEngine::JITCtor)(    JITMemoryManager *JMM,    CodeGenOpt::Level OptLevel,    bool GVsWithCode, -  TargetMachine *TM) = 0; +  CodeModel::Model CMM, +  StringRef MArch, +  StringRef MCPU, +  const SmallVectorImpl<std::string>& MAttrs) = 0;  ExecutionEngine *(*ExecutionEngine::MCJITCtor)(    Module *M,    std::string *ErrorStr,    JITMemoryManager *JMM,    CodeGenOpt::Level OptLevel,    bool GVsWithCode, -  TargetMachine *TM) = 0; +  CodeModel::Model CMM, +  StringRef MArch, +  StringRef MCPU, +  const SmallVectorImpl<std::string>& MAttrs) = 0;  ExecutionEngine *(*ExecutionEngine::InterpCtor)(Module *M,                                                  std::string *ErrorStr) = 0; @@ -414,35 +419,6 @@ ExecutionEngine *ExecutionEngine::create(Module *M,        .create();  } -/// createJIT - This is the factory method for creating a JIT for the current -/// machine, it does not fall back to the interpreter.  This takes ownership -/// of the module. -ExecutionEngine *ExecutionEngine::createJIT(Module *M, -                                            std::string *ErrorStr, -                                            JITMemoryManager *JMM, -                                            CodeGenOpt::Level OptLevel, -                                            bool GVsWithCode, -                                            CodeModel::Model CMM) { -  if (ExecutionEngine::JITCtor == 0) { -    if (ErrorStr) -      *ErrorStr = "JIT has not been linked in."; -    return 0; -  } - -  // Use the defaults for extra parameters.  Users can use EngineBuilder to -  // set them. -  StringRef MArch = ""; -  StringRef MCPU = ""; -  SmallVector<std::string, 1> MAttrs; - -  TargetMachine *TM = -          ExecutionEngine::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr); -  if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0; -  TM->setCodeModel(CMM); - -  return ExecutionEngine::JITCtor(M, ErrorStr, JMM, OptLevel, GVsWithCode, TM); -} -  ExecutionEngine *EngineBuilder::create() {    // Make sure we can resolve symbols in the program as well. The zero arg    // to the function tells DynamicLibrary to load the program, not a library. @@ -465,20 +441,17 @@ ExecutionEngine *EngineBuilder::create() {    // Unless the interpreter was explicitly selected or the JIT is not linked,    // try making a JIT.    if (WhichEngine & EngineKind::JIT) { -    TargetMachine *TM = -        ExecutionEngine::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr); -    if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0; -    TM->setCodeModel(CMModel); -      if (UseMCJIT && ExecutionEngine::MCJITCtor) {        ExecutionEngine *EE =          ExecutionEngine::MCJITCtor(M, ErrorStr, JMM, OptLevel, -                                   AllocateGVsWithCode, TM); +                                   AllocateGVsWithCode, CMModel, +                                   MArch, MCPU, MAttrs);        if (EE) return EE;      } else if (ExecutionEngine::JITCtor) {        ExecutionEngine *EE =          ExecutionEngine::JITCtor(M, ErrorStr, JMM, OptLevel, -                                 AllocateGVsWithCode, TM); +                                 AllocateGVsWithCode, CMModel, +                                 MArch, MCPU, MAttrs);        if (EE) return EE;      }    }  | 
