]> granicus.if.org Git - llvm/commitdiff
Use isa<> instead of dyn_cast<> (NFC).
authorAdrian Prantl <aprantl@apple.com>
Mon, 20 Mar 2017 16:39:41 +0000 (16:39 +0000)
committerAdrian Prantl <aprantl@apple.com>
Mon, 20 Mar 2017 16:39:41 +0000 (16:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298268 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/Local.cpp

index 46996323b59ef271952cd2c7d254156335dd2a3a..3b1e501bd73903d55393a00017c7518c09b36051 100644 (file)
@@ -1361,8 +1361,8 @@ void llvm::salvageDebugInfo(Instruction &I) {
     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 &I) {
       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 &I) {
         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();