]> granicus.if.org Git - clang/commitdiff
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348189 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTDumper.cpp

index fb7804770fae69099961ba01f7ca980ca3b89eaf..8007282fe489a2457da42abd6faa4ad945a5fe77 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);
   });