]> granicus.if.org Git - llvm/commitdiff
Fix unused variable warning in -asserts builds.
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 24 Jun 2016 21:37:11 +0000 (21:37 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 24 Jun 2016 21:37:11 +0000 (21:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273737 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/CrossDSOCFI.cpp

index 99d583339548c967b5c015385a03ea1bf36cae97..d95ba327a9ab1a1e15db517f992e10b20d2311e2 100644 (file)
@@ -98,8 +98,7 @@ void CrossDSOCFI::buildCFICheck() {
     GO.getMetadata(LLVMContext::MD_type, Types);
     for (MDNode *Type : Types) {
       // Sanity check. GO must not be a function declaration.
-      auto F = dyn_cast<Function>(&GO);
-      assert(!F || !F->isDeclaration());
+      assert(!isa<Function>(&GO) || !cast<Function>(&GO)->isDeclaration());
 
       if (ConstantInt *TypeId = extractNumericTypeId(Type))
         TypeIds.insert(TypeId->getZExtValue());