Skip to content

Commit faa4e49

Browse files
committed
ExecutionEngine::create(): fix interpreter fallback when JIT is unavailable
ForceInterpreter=false shouldn't disable the interpreter completely because it can still be necessary to interpret if the target doesn't support JIT. No obvious way to test this in LLVM, but this matches what LLVMCreateExecutionEngineForModule() does and fixes the clang-interpreter example in the clang source tree which uses the ExecutionEngine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212086 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 7186dd4 commit faa4e49

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/ExecutionEngine/ExecutionEngine.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,14 @@ ExecutionEngine *ExecutionEngine::create(Module *M,
411411
std::string *ErrorStr,
412412
CodeGenOpt::Level OptLevel,
413413
bool GVsWithCode) {
414-
EngineBuilder EB = EngineBuilder(M)
415-
.setEngineKind(ForceInterpreter
416-
? EngineKind::Interpreter
417-
: EngineKind::JIT)
418-
.setErrorStr(ErrorStr)
419-
.setOptLevel(OptLevel)
420-
.setAllocateGVsWithCode(GVsWithCode);
414+
415+
EngineBuilder EB =
416+
EngineBuilder(M)
417+
.setEngineKind(ForceInterpreter ? EngineKind::Interpreter
418+
: EngineKind::Either)
419+
.setErrorStr(ErrorStr)
420+
.setOptLevel(OptLevel)
421+
.setAllocateGVsWithCode(GVsWithCode);
421422

422423
return EB.create();
423424
}

0 commit comments

Comments
 (0)