[llvm] r224281 - Clean up warning about unused variable

Michael Ilseman milseman at apple.com
Mon Dec 15 13:47:09 PST 2014


Author: milseman
Date: Mon Dec 15 15:47:09 2014
New Revision: 224281

URL: http://llvm.org/viewvc/llvm-project?rev=224281&view=rev
Log:
Clean up warning about unused variable

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=224281&r1=224280&r2=224281&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Dec 15 15:47:09 2014
@@ -1532,8 +1532,10 @@ bool ModuleLinker::run() {
     GlobalValue *SGV = LazilyLinkGlobalValues.back();
     LazilyLinkGlobalValues.pop_back();
 
-    if (auto F = dyn_cast<Function>(SGV))
-      assert(!F->isDeclaration() && "users should not pass down decls");
+    if (isa<Function>(SGV))
+      assert(!cast<Function>(SGV)->isDeclaration() &&
+             "users should not pass down decls");
+
     if (linkGlobalValueBody(*SGV))
       return true;
   }





More information about the llvm-commits mailing list