aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2013-11-15 22:10:21 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2013-11-15 22:10:21 +0000
commit59bbf5a759a4891ea90ac67f13485f67ef42234c (patch)
tree1c61431b65568613115e451ba728245d4a8c24fd
parentc3ec7e2273a26d8ae3b8d98160e13f8f44299ad2 (diff)
downloadexternal_llvm-59bbf5a759a4891ea90ac67f13485f67ef42234c.zip
external_llvm-59bbf5a759a4891ea90ac67f13485f67ef42234c.tar.gz
external_llvm-59bbf5a759a4891ea90ac67f13485f67ef42234c.tar.bz2
Fix a problem in MCJIT identifying the module containing a global variable.
Patch by Keno Fischer! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194859 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/ExecutionEngine/MCJIT/MCJIT.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index da4164e..195c458 100644
--- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -248,11 +248,11 @@ Module *MCJIT::findModuleForSymbol(const std::string &Name,
I != E; ++I) {
Module *M = *I;
Function *F = M->getFunction(Name);
- if (F && !F->empty())
+ if (F && !F->isDeclaration())
return M;
if (!CheckFunctionsOnly) {
GlobalVariable *G = M->getGlobalVariable(Name);
- if (G)
+ if (G && !G->isDeclaration())
return M;
// FIXME: Do we need to worry about global aliases?
}