[llvm] r224382 - Make the assert a bit stronger.

Rafael Espindola rafael.espindola at gmail.com
Tue Dec 16 14:29:44 PST 2014


Author: rafael
Date: Tue Dec 16 16:29:43 2014
New Revision: 224382

URL: http://llvm.org/viewvc/llvm-project?rev=224382&view=rev
Log:
Make the assert a bit stronger.

We should get no declarations in here.

Modified:
    llvm/trunk/lib/Linker/LinkModules.cpp

Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=224382&r1=224381&r2=224382&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Tue Dec 16 16:29:43 2014
@@ -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;
   }





More information about the llvm-commits mailing list