Fix a problem in MCJIT identifying the module containing a global variable.

Patch by Keno Fischer!

llvm-svn: 194859
This commit is contained in:
Andrew Kaylor 2013-11-15 22:10:21 +00:00
parent f14032af0e
commit 515b1daad3
1 changed files with 2 additions and 2 deletions

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?
} }