NFC: Simplify dumpStmt child handling
authorStephen Kelly <steveire@gmail.com>
Mon, 3 Dec 2018 21:05:52 +0000 (21:05 +0000)
committerStephen Kelly <steveire@gmail.com>
Mon, 3 Dec 2018 21:05:52 +0000 (21:05 +0000)
Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 348189

clang/lib/AST/ASTDumper.cpp

index fb78047..8007282 100644 (file)
@@ -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);
   });