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
This commit is contained in:
Andrew Kaylor
2013-11-15 22:10:21 +00:00
parent c3ec7e2273
commit 59bbf5a759

View File

@@ -248,11 +248,11 @@ Module *MCJIT::findModuleForSymbol(const std::string &Name,
I != E; ++I) { I != E; ++I) {
Module *M = *I; Module *M = *I;
Function *F = M->getFunction(Name); Function *F = M->getFunction(Name);
if (F && !F->empty()) if (F && !F->isDeclaration())
return M; return M;
if (!CheckFunctionsOnly) { if (!CheckFunctionsOnly) {
GlobalVariable *G = M->getGlobalVariable(Name); GlobalVariable *G = M->getGlobalVariable(Name);
if (G) if (G && !G->isDeclaration())
return M; return M;
// FIXME: Do we need to worry about global aliases? // FIXME: Do we need to worry about global aliases?
} }