diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index d6f4ef81d74..cba6f1a3181 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -1532,10 +1532,8 @@ bool ModuleLinker::run() { GlobalValue *SGV = LazilyLinkGlobalValues.back(); LazilyLinkGlobalValues.pop_back(); - if (isa(SGV)) - assert(!cast(SGV)->isDeclaration() && - "users should not pass down decls"); - + assert((!isa(SGV) || !cast(SGV)->isDeclaration()) && + "users should not pass down decls"); if (linkGlobalValueBody(*SGV)) return true; }