r348189 - NFC: Simplify dumpStmt child handling

Stephen Kelly via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 3 13:05:53 PST 2018


Author: steveire
Date: Mon Dec  3 13:05:52 2018
New Revision: 348189

URL: http://llvm.org/viewvc/llvm-project?rev=348189&view=rev
Log:
NFC: Simplify dumpStmt child handling

Reviewers: aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D55068

Modified:
    cfe/trunk/lib/AST/ASTDumper.cpp

Modified: cfe/trunk/lib/AST/ASTDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=348189&r1=348188&r2=348189&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Mon Dec  3 13:05:52 2018
@@ -1989,18 +1989,13 @@ void ASTDumper::dumpStmt(const Stmt *S)
       return;
     }
 
+    ConstStmtVisitor<ASTDumper>::Visit(S);
+
     // Some statements have custom mechanisms for dumping their children.
-    if (const DeclStmt *DS = dyn_cast<DeclStmt>(S)) {
-      VisitDeclStmt(DS);
-      return;
-    }
-    if (const GenericSelectionExpr *GSE = dyn_cast<GenericSelectionExpr>(S)) {
-      VisitGenericSelectionExpr(GSE);
+    if (isa<DeclStmt>(S) || isa<GenericSelectionExpr>(S)) {
       return;
     }
 
-    ConstStmtVisitor<ASTDumper>::Visit(S);
-
     for (const Stmt *SubStmt : S->children())
       dumpStmt(SubStmt);
   });




More information about the cfe-commits mailing list