[llvm-commits] CVS: llvm/lib/ExecutionEngine/ExecutionEngine.cpp
Reid Spencer
reid at x10sys.com
Mon Nov 29 06:11:40 PST 2004
Changes in directory llvm/lib/ExecutionEngine:
ExecutionEngine.cpp updated: 1.62 -> 1.63
---
Log message:
Use System/DynamicLibrary instead of Support/DynamicLinker
---
Diffs of the changes: (+12 -5)
Index: llvm/lib/ExecutionEngine/ExecutionEngine.cpp
diff -u llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.62 llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.63
--- llvm/lib/ExecutionEngine/ExecutionEngine.cpp:1.62 Fri Nov 19 02:44:07 2004
+++ llvm/lib/ExecutionEngine/ExecutionEngine.cpp Mon Nov 29 08:11:29 2004
@@ -19,13 +19,13 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/GenericValue.h"
-#include "llvm/Target/TargetData.h"
#include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
-#include "llvm/Support/DynamicLinker.h"
+#include "llvm/System/DynamicLibrary.h"
+#include "llvm/Target/TargetData.h"
using namespace llvm;
namespace {
@@ -151,7 +151,13 @@
}
}
- if (EE == 0) delete IL;
+ if (EE == 0)
+ delete IL;
+ else
+ // 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.
+ sys::DynamicLibrary::LoadLibraryPermanently(0);
+
return EE;
}
@@ -502,7 +508,8 @@
} else {
// External variable reference. Try to use the dynamic loader to
// get a pointer to it.
- if (void *SymAddr = GetAddressOfSymbol(I->getName().c_str()))
+ if (void *SymAddr = sys::DynamicLibrary::SearchForAddressOfSymbol(
+ I->getName().c_str()))
addGlobalMapping(I, SymAddr);
else {
std::cerr << "Could not resolve external global address: "
More information about the llvm-commits
mailing list