summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2010-08-17 16:19:18 +0000
committerNick Lewycky <nicholas@mxc.ca>2010-08-17 16:19:18 +0000
commit83a09f0b4f4d3cad8e45e30c41dc1ad0fc06b7b3 (patch)
treeb457e766496d3e51b04bc6f949119210401d4d43
parent175ea046ee1c7162dbf002636eb98f134f40a9e0 (diff)
downloadbcm5719-llvm-83a09f0b4f4d3cad8e45e30c41dc1ad0fc06b7b3.tar.gz
bcm5719-llvm-83a09f0b4f4d3cad8e45e30c41dc1ad0fc06b7b3.zip
When creating a JIT, try to load the program so that we can resolve symbols
against it. This affects Windows. llvm-svn: 111240
-rw-r--r--llvm/lib/ExecutionEngine/JIT/JIT.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
index 677feb21e16..63125b79c8e 100644
--- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
@@ -219,6 +219,9 @@ ExecutionEngine *JIT::createJIT(Module *M,
StringRef MArch,
StringRef MCPU,
const SmallVectorImpl<std::string>& MAttrs) {
+ // Try to register the program as a source of symbols to resolve against.
+ sys::DynamicLibrary::LoadLibraryPermanently(0, NULL);
+
// Pick a target either via -march or by guessing the native arch.
TargetMachine *TM = JIT::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr);
if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0;
OpenPOWER on IntegriCloud