Sink the isa into the assert
authorMichael Ilseman <milseman@apple.com>
Mon, 15 Dec 2014 23:41:21 +0000 (23:41 +0000)
committerMichael Ilseman <milseman@apple.com>
Mon, 15 Dec 2014 23:41:21 +0000 (23:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224291 91177308-0d34-0410-b5e6-96231b3b80d8

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;
   }