[llvm-commits] [llvm] r48046 - /llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp

Nick Lewycky nicholas at mxc.ca
Fri Mar 7 18:49:45 PST 2008


Author: nicholas
Date: Fri Mar  7 20:49:45 2008
New Revision: 48046

URL: http://llvm.org/viewvc/llvm-project?rev=48046&view=rev
Log:
Load the symbols first so that the interpreter constructor can find them when
it tries to initialize them.

Modified:
    llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp

Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=48046&r1=48045&r2=48046&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Fri Mar  7 20:49:45 2008
@@ -317,6 +317,11 @@
                                          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 @@
   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;
 }
 





More information about the llvm-commits mailing list