summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-03-08 02:49:45 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-03-08 02:49:45 +0000
commita53414fd79f78ee960740a15ea85307dee5b7ecf (patch)
tree4ba637f4d5b86bb438d445bc874bb7843cfc1296 /llvm/lib/ExecutionEngine
parente2e69ff426d946e9b0be5b86ffc1ea7288ca5fd0 (diff)
downloadbcm5719-llvm-a53414fd79f78ee960740a15ea85307dee5b7ecf.tar.gz
bcm5719-llvm-a53414fd79f78ee960740a15ea85307dee5b7ecf.zip
Load the symbols first so that the interpreter constructor can find them when
it tries to initialize them. llvm-svn: 48046
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/ExecutionEngine.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
index 8796a2d2e6c..95df900a4bd 100644
--- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -317,6 +317,11 @@ ExecutionEngine *ExecutionEngine::create(ModuleProvider *MP,
std::string *ErrorStr) {
ExecutionEngine *EE = 0;
+ // Make sure we can resolve symbols in the program as well. The zero arg
+ // to the function tells DynamicLibrary to load the program, not a library.
+ if (sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr))
+ return 0;
+
// Unless the interpreter was explicitly selected, try making a JIT.
if (!ForceInterpreter && JITCtor)
EE = JITCtor(MP, ErrorStr);
@@ -325,15 +330,6 @@ ExecutionEngine *ExecutionEngine::create(ModuleProvider *MP,
if (EE == 0 && InterpCtor)
EE = InterpCtor(MP, ErrorStr);
- if (EE) {
- // Make sure we can resolve symbols in the program as well. The zero arg
- // to the function tells DynamicLibrary to load the program, not a library.
- if (sys::DynamicLibrary::LoadLibraryPermanently(0, ErrorStr)) {
- delete EE;
- return 0;
- }
- }
-
return EE;
}
OpenPOWER on IntegriCloud