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.

llvm-svn: 224382

llvm/lib/Linker/LinkModules.cpp

index cba6f1a..0e14415 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;
   }