Load the symbols first so that the interpreter constructor can find them when

it tries to initialize them.

llvm-svn: 48046
This commit is contained in:
Nick Lewycky 2008-03-08 02:49:45 +00:00
parent e2e69ff426
commit a53414fd79
1 changed files with 5 additions and 9 deletions

View File

@ -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;
}