diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-11-15 22:10:21 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2013-11-15 22:10:21 +0000 |
commit | 59bbf5a759a4891ea90ac67f13485f67ef42234c (patch) | |
tree | 1c61431b65568613115e451ba728245d4a8c24fd | |
parent | c3ec7e2273a26d8ae3b8d98160e13f8f44299ad2 (diff) | |
download | external_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.cpp | 4 |
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? } |