[llvm] r243143 - DI: Strengthen some dyn_casts to DIDerivedType, NFC

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri Jul 24 12:17:20 PDT 2015


Author: dexonsmith
Date: Fri Jul 24 14:17:20 2015
New Revision: 243143

URL: http://llvm.org/viewvc/llvm-project?rev=243143&view=rev
Log:
DI: Strengthen some dyn_casts to DIDerivedType, NFC

The surrounding code proves in both cases that these must be
`DIDerivedType` if they're `DIDerivedTypeBase`, so strengthen the
`dyn_cast`s to the more specific type.

Modified:
    llvm/trunk/lib/IR/DebugInfo.cpp

Modified: llvm/trunk/lib/IR/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=243143&r1=243142&r2=243143&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfo.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfo.cpp Fri Jul 24 14:17:20 2015
@@ -60,7 +60,7 @@ DICompositeTypeBase *llvm::getDIComposit
   if (auto *C = dyn_cast_or_null<DICompositeTypeBase>(T))
     return C;
 
-  if (auto *D = dyn_cast_or_null<DIDerivedTypeBase>(T)) {
+  if (auto *D = dyn_cast_or_null<DIDerivedType>(T)) {
     // This function is currently used by dragonegg and dragonegg does
     // not generate identifier for types, so using an empty map to resolve
     // DerivedFrom should be fine.
@@ -177,7 +177,7 @@ void DebugInfoFinder::processType(DIType
       else if (auto *SP = dyn_cast<DISubprogram>(D))
         processSubprogram(SP);
     }
-  } else if (auto *DDT = dyn_cast<DIDerivedTypeBase>(DT)) {
+  } else if (auto *DDT = dyn_cast<DIDerivedType>(DT)) {
     processType(DDT->getBaseType().resolve(TypeIdentifierMap));
   }
 }





More information about the llvm-commits mailing list