From ebaf61e498dd3f795adf87eab10542636d07bff1 Mon Sep 17 00:00:00 2001 From: Michael Ilseman Date: Tue, 9 Dec 2014 08:20:06 +0000 Subject: [PATCH] Skip declarations in the case of functions. This is a revert of r223521 in spirit, if not in content. I am not sure why declarations ended up in LazilyLinkGlobalValues in the first place; that will take some more investigation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223763 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Linker/LinkModules.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index bf07644870a..dd637be05aa 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -1533,6 +1533,9 @@ bool ModuleLinker::run() { GlobalValue *SGV = LazilyLinkGlobalValues.back(); LazilyLinkGlobalValues.pop_back(); + if (auto F = dyn_cast(SGV)) + if (F->isDeclaration()) + continue; if (linkGlobalValueBody(*SGV)) return true; } -- 2.34.1