Sink the isa into the assert
[oota-llvm.git] / lib / Linker / LinkModules.cpp
index d6f4ef81d743872816bb3bd975a63c68344d60cf..cba6f1a31816f78f6d48dd065bbdea199e518eaa 100644 (file)
@@ -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;
   }