mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Add EngineBuilder to ExecutionEngine in favor of the five optional argument EE::create().
Also a test commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76276 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -91,7 +91,10 @@ int LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE,
|
||||
LLVMModuleProviderRef MP,
|
||||
char **OutError) {
|
||||
std::string Error;
|
||||
if (ExecutionEngine *EE = ExecutionEngine::create(unwrap(MP), false, &Error)){
|
||||
EngineBuilder builder(unwrap(MP));
|
||||
builder.setEngineKind(EngineKind::Either)
|
||||
.setErrorStr(&Error);
|
||||
if (ExecutionEngine *EE = builder.create()){
|
||||
*OutEE = wrap(EE);
|
||||
return 0;
|
||||
}
|
||||
@ -103,8 +106,10 @@ int LLVMCreateInterpreter(LLVMExecutionEngineRef *OutInterp,
|
||||
LLVMModuleProviderRef MP,
|
||||
char **OutError) {
|
||||
std::string Error;
|
||||
if (ExecutionEngine *Interp =
|
||||
ExecutionEngine::create(unwrap(MP), true, &Error)) {
|
||||
EngineBuilder builder(unwrap(MP));
|
||||
builder.setEngineKind(EngineKind::Interpreter)
|
||||
.setErrorStr(&Error);
|
||||
if (ExecutionEngine *Interp = builder.create()) {
|
||||
*OutInterp = wrap(Interp);
|
||||
return 0;
|
||||
}
|
||||
@ -117,9 +122,11 @@ int LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT,
|
||||
unsigned OptLevel,
|
||||
char **OutError) {
|
||||
std::string Error;
|
||||
if (ExecutionEngine *JIT =
|
||||
ExecutionEngine::create(unwrap(MP), false, &Error,
|
||||
(CodeGenOpt::Level)OptLevel)) {
|
||||
EngineBuilder builder(unwrap(MP));
|
||||
builder.setEngineKind(EngineKind::JIT)
|
||||
.setErrorStr(&Error)
|
||||
.setOptLevel((CodeGenOpt::Level)OptLevel);
|
||||
if (ExecutionEngine *JIT = builder.create()) {
|
||||
*OutJIT = wrap(JIT);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user