diff options
Diffstat (limited to 'llvm/lib/Linker/LinkModules.cpp')
-rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 9c3f1834801..d6f4ef81d74 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -1532,8 +1532,10 @@ bool ModuleLinker::run() { GlobalValue *SGV = LazilyLinkGlobalValues.back(); LazilyLinkGlobalValues.pop_back(); - if (auto F = dyn_cast<Function>(SGV)) - assert(!F->isDeclaration() && "users should not pass down decls"); + if (isa<Function>(SGV)) + assert(!cast<Function>(SGV)->isDeclaration() && + "users should not pass down decls"); + if (linkGlobalValueBody(*SGV)) return true; } |