diff options
| author | Alp Toker <alp@nuanti.com> | 2014-07-01 03:18:49 +0000 |
|---|---|---|
| committer | Alp Toker <alp@nuanti.com> | 2014-07-01 03:18:49 +0000 |
| commit | 568c31f236e71e9771c5c076ea51eb01f4e6fa57 (patch) | |
| tree | 04b9e4a6f474da890ed59642cd8c50bbd6a59813 /llvm/lib/ExecutionEngine | |
| parent | b89e6d93d9c12f9f5ed697144286d5aba06e9db1 (diff) | |
| download | bcm5719-llvm-568c31f236e71e9771c5c076ea51eb01f4e6fa57.tar.gz bcm5719-llvm-568c31f236e71e9771c5c076ea51eb01f4e6fa57.zip | |
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.
llvm-svn: 212086
Diffstat (limited to 'llvm/lib/ExecutionEngine')
| -rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 9154fe2f5ff..b0e985d6dd5 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/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(); } |

