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