From 59bbf5a759a4891ea90ac67f13485f67ef42234c Mon Sep 17 00:00:00 2001 From: Andrew Kaylor Date: Fri, 15 Nov 2013 22:10:21 +0000 Subject: [PATCH] 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 --- lib/ExecutionEngine/MCJIT/MCJIT.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp index da4164e6476..195c45850c6 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? } -- 2.34.1