Make the assert a bit stronger.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 16 Dec 2014 22:29:43 +0000 (22:29 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 16 Dec 2014 22:29:43 +0000 (22:29 +0000)
We should get no declarations in here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224382 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp

index cba6f1a31816f78f6d48dd065bbdea199e518eaa..0e144157af4d8b68bfd50dce801fc5d0e6e0eb85 100644 (file)
@@ -1532,8 +1532,7 @@ bool ModuleLinker::run() {
     GlobalValue *SGV = LazilyLinkGlobalValues.back();
     LazilyLinkGlobalValues.pop_back();
 
-    assert((!isa<Function>(SGV) || !cast<Function>(SGV)->isDeclaration()) &&
-           "users should not pass down decls");
+    assert(!SGV->isDeclaration() && "users should not pass down decls");
     if (linkGlobalValueBody(*SGV))
       return true;
   }