[llvm] r298268 - Use isa<> instead of dyn_cast<> (NFC).

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 09:39:41 PDT 2017


Author: adrian
Date: Mon Mar 20 11:39:41 2017
New Revision: 298268

URL: http://llvm.org/viewvc/llvm-project?rev=298268&view=rev
Log:
Use isa<> instead of dyn_cast<> (NFC).

Modified:
    llvm/trunk/lib/Transforms/Utils/Local.cpp

Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=298268&r1=298267&r2=298268&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Mon Mar 20 11:39:41 2017
@@ -1361,8 +1361,8 @@ void llvm::salvageDebugInfo(Instruction
     return MetadataAsValue::get(I.getContext(), ValueAsMetadata::get(V));
   };
 
-  if (auto *BitCast = dyn_cast<BitCastInst>(&I)) {
-    findDbgValues(DbgValues, BitCast);
+  if (isa<BitCastInst>(&I)) {
+    findDbgValues(DbgValues, &I);
     for (auto *DVI : DbgValues) {
       // Bitcasts are entirely irrelevant for debug info. Rewrite the dbg.value
       // to use the cast's source.
@@ -1370,7 +1370,7 @@ void llvm::salvageDebugInfo(Instruction
       DEBUG(dbgs() << "SALVAGE: " << *DVI << '\n');
     }
   } else if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) {
-    findDbgValues(DbgValues, GEP);
+    findDbgValues(DbgValues, &I);
     for (auto *DVI : DbgValues) {
       unsigned BitWidth =
           M.getDataLayout().getPointerSizeInBits(GEP->getPointerAddressSpace());
@@ -1386,8 +1386,8 @@ void llvm::salvageDebugInfo(Instruction
         DEBUG(dbgs() << "SALVAGE: " << *DVI << '\n');
       }
     }
-  } else if (auto *Load = dyn_cast<LoadInst>(&I)) {
-    findDbgValues(DbgValues, Load);
+  } else if (isa<LoadInst>(&I)) {
+    findDbgValues(DbgValues, &I);
     for (auto *DVI : DbgValues) {
       // Rewrite the load into DW_OP_deref.
       auto *DIExpr = DVI->getExpression();




More information about the llvm-commits mailing list