aboutsummaryrefslogtreecommitdiffstats
path: root/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
commit6456d8639b6f3ede1bb1a90a5d33fe4e719ad4ac (patch)
tree47127f8c62fa584fa406bff3ffef2a12693f4f9e /lib/ExecutionEngine
parentebb8d7ba164665e3ff4356baab4dbdeddb5fc02c (diff)
downloadexternal_llvm-6456d8639b6f3ede1bb1a90a5d33fe4e719ad4ac.zip
external_llvm-6456d8639b6f3ede1bb1a90a5d33fe4e719ad4ac.tar.gz
external_llvm-6456d8639b6f3ede1bb1a90a5d33fe4e719ad4ac.tar.bz2
Load the symbols first so that the interpreter constructor can find them when
it tries to initialize them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48046 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index 8796a2d..95df900 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/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;
}