From: Adrian Prantl Date: Mon, 20 Mar 2017 16:39:41 +0000 (+0000) Subject: Use isa<> instead of dyn_cast<> (NFC). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4a14c1d2acb3c5429ea113a74078129b7a58cce;p=llvm Use isa<> instead of dyn_cast<> (NFC). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298268 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 46996323b59..3b1e501bd73 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -1361,8 +1361,8 @@ void llvm::salvageDebugInfo(Instruction &I) { return MetadataAsValue::get(I.getContext(), ValueAsMetadata::get(V)); }; - if (auto *BitCast = dyn_cast(&I)) { - findDbgValues(DbgValues, BitCast); + if (isa(&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(&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(&I)) { - findDbgValues(DbgValues, Load); + } else if (isa(&I)) { + findDbgValues(DbgValues, &I); for (auto *DVI : DbgValues) { // Rewrite the load into DW_OP_deref. auto *DIExpr = DVI->getExpression();