From faa4e49b330e777e6de1be84a72de3cb6278dede Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Tue, 1 Jul 2014 03:18:49 +0000 Subject: [PATCH] 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 --- lib/ExecutionEngine/ExecutionEngine.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 9154fe2f5ff..b0e985d6dd5 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -411,13 +411,14 @@ ExecutionEngine *ExecutionEngine::create(Module *M, std::string *ErrorStr, CodeGenOpt::Level OptLevel, bool GVsWithCode) { - EngineBuilder EB = EngineBuilder(M) - .setEngineKind(ForceInterpreter - ? EngineKind::Interpreter - : EngineKind::JIT) - .setErrorStr(ErrorStr) - .setOptLevel(OptLevel) - .setAllocateGVsWithCode(GVsWithCode); + + EngineBuilder EB = + EngineBuilder(M) + .setEngineKind(ForceInterpreter ? EngineKind::Interpreter + : EngineKind::Either) + .setErrorStr(ErrorStr) + .setOptLevel(OptLevel) + .setAllocateGVsWithCode(GVsWithCode); return EB.create(); }