r331578 - Fix a couple places that immediately called operator-> on the result of dyn_cast.

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Fri May 4 18:58:27 PDT 2018


Author: ctopper
Date: Fri May  4 18:58:26 2018
New Revision: 331578

URL: http://llvm.org/viewvc/llvm-project?rev=331578&view=rev
Log:
Fix a couple places that immediately called operator-> on the result of dyn_cast.

It looks like it safe to just use cast for both cases.

Modified:
    cfe/trunk/lib/AST/QualTypeNames.cpp
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp

Modified: cfe/trunk/lib/AST/QualTypeNames.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/QualTypeNames.cpp?rev=331578&r1=331577&r2=331578&view=diff
==============================================================================
--- cfe/trunk/lib/AST/QualTypeNames.cpp (original)
+++ cfe/trunk/lib/AST/QualTypeNames.cpp Fri May  4 18:58:26 2018
@@ -408,7 +408,7 @@ QualType getFullyQualifiedType(QualType
     // Get the qualifiers.
     Qualifiers Quals = QT.getQualifiers();
 
-    QT = dyn_cast<SubstTemplateTypeParmType>(QT.getTypePtr())->desugar();
+    QT = cast<SubstTemplateTypeParmType>(QT.getTypePtr())->desugar();
 
     // Add back the qualifiers.
     QT = Ctx.getQualifiedType(QT, Quals);

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp?rev=331578&r1=331577&r2=331578&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp Fri May  4 18:58:26 2018
@@ -483,7 +483,7 @@ private:
       if (!(isa<FieldRegion>(R) || isa<CXXBaseObjectRegion>(R)))
         return false; // Pattern-matching failed.
       Subregions.push_back(R);
-      R = dyn_cast<SubRegion>(R)->getSuperRegion();
+      R = cast<SubRegion>(R)->getSuperRegion();
     }
     bool IndirectReference = !Subregions.empty();
 




More information about the cfe-commits mailing list