summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-23 02:03:49 +0000
committerChris Lattner <sabre@nondot.org>2009-09-23 02:03:49 +0000
commitc72efbeb42a9eaa0a83b8bba4954dcaf9ae64103 (patch)
treee69093a817a7cc7a49b1289979a7c2d8f26e2a3d /lib/ExecutionEngine/ExecutionEngine.cpp
parentfbd39762e9db897ffd8e30ce7d387715cba6d4c1 (diff)
downloadllvm-c72efbeb42a9eaa0a83b8bba4954dcaf9ae64103.tar.gz
llvm-c72efbeb42a9eaa0a83b8bba4954dcaf9ae64103.tar.bz2
llvm-c72efbeb42a9eaa0a83b8bba4954dcaf9ae64103.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index fa6209d2df..335d4deff8 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/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;
}