diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-23 02:03:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-23 02:03:49 +0000 |
commit | 8bcc6445c71d2c06e1fbcfe9ad6e07e8a1ff871a (patch) | |
tree | ce5499f72b47b0cd86e9b0d99398288cee4aeefd /llvm/lib/ExecutionEngine | |
parent | 41fa2bd112bfd462ba67c54667a92ff3b29a5c23 (diff) | |
download | bcm5719-llvm-8bcc6445c71d2c06e1fbcfe9ad6e07e8a1ff871a.tar.gz bcm5719-llvm-8bcc6445c71d2c06e1fbcfe9ad6e07e8a1ff871a.zip |
errorstr can be null, don't unconditionally set it. Only report that
"the jit has not been linked in" if the interpreter failed.
This fixes a unit test failure.
llvm-svn: 82601
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index fa6209d2dff..335d4deff84 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -429,7 +429,8 @@ ExecutionEngine *EngineBuilder::create() { if (WhichEngine & EngineKind::JIT) WhichEngine = EngineKind::JIT; else { - *ErrorStr = "Cannot create an interpreter with a memory manager."; + if (ErrorStr) + *ErrorStr = "Cannot create an interpreter with a memory manager."; return 0; } } @@ -442,9 +443,6 @@ ExecutionEngine *EngineBuilder::create() { ExecutionEngine::JITCtor(MP, ErrorStr, JMM, OptLevel, AllocateGVsWithCode); if (EE) return EE; - } else { - *ErrorStr = "JIT has not been linked in."; - return 0; } } @@ -453,10 +451,15 @@ ExecutionEngine *EngineBuilder::create() { if (WhichEngine & EngineKind::Interpreter) { if (ExecutionEngine::InterpCtor) return ExecutionEngine::InterpCtor(MP, ErrorStr); - *ErrorStr = "Interpreter has not been linked in."; + if (ErrorStr) + *ErrorStr = "Interpreter has not been linked in."; return 0; } - + + if ((WhichEngine & EngineKind::JIT) && ExecutionEngine::JITCtor == 0) { + if (ErrorStr) + *ErrorStr = "JIT has not been linked in."; + } return 0; } |