mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
ExecutionEngine: move createJIT() definition (v2)
As an ExecutionEngine class function, its definition really belongs in ExecutionEngine.cpp, not JIT.cpp. llvm-svn: 131320
This commit is contained in:
parent
7181ae008c
commit
e3f823351d
@ -414,6 +414,35 @@ 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 =
|
||||
EngineBuilder::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.
|
||||
|
@ -203,25 +203,6 @@ void DarwinRegisterFrame(void* FrameBegin) {
|
||||
/// 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) {
|
||||
// Use the defaults for extra parameters. Users can use EngineBuilder to
|
||||
// set them.
|
||||
StringRef MArch = "";
|
||||
StringRef MCPU = "";
|
||||
SmallVector<std::string, 1> MAttrs;
|
||||
TargetMachine *TM =
|
||||
EngineBuilder::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr);
|
||||
if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0;
|
||||
TM->setCodeModel(CMM);
|
||||
|
||||
return JIT::createJIT(M, ErrorStr, JMM, OptLevel, GVsWithCode, TM);
|
||||
}
|
||||
|
||||
ExecutionEngine *JIT::createJIT(Module *M,
|
||||
std::string *ErrorStr,
|
||||
JITMemoryManager *JMM,
|
||||
|
Loading…
Reference in New Issue
Block a user