steveire created this revision.
steveire added a reviewer: aaron.ballman.
Herald added a subscriber: cfe-commits.

This call is duplicated in Visits of all direct subclasses of Stmt.


Repository:
  rC Clang

https://reviews.llvm.org/D55338

Files:
  lib/AST/ASTDumper.cpp

Index: lib/AST/ASTDumper.cpp
===================================================================
--- lib/AST/ASTDumper.cpp
+++ lib/AST/ASTDumper.cpp
@@ -364,7 +364,6 @@
     void VisitBlockDecl(const BlockDecl *D);
 
     // Stmts.
-    void VisitStmt(const Stmt *Node);
     void VisitDeclStmt(const DeclStmt *Node);
     void VisitAttributedStmt(const AttributedStmt *Node);
     void VisitIfStmt(const IfStmt *Node);
@@ -1691,6 +1690,12 @@
       OS << "<<<NULL>>>";
       return;
     }
+    {
+      ColorScope Color(OS, ShowColors, StmtColor);
+      OS << S->getStmtClassName();
+    }
+    NodeDumper.dumpPointer(S);
+    NodeDumper.dumpSourceRange(S->getSourceRange());
 
     ConstStmtVisitor<ASTDumper>::Visit(S);
 
@@ -1704,17 +1709,7 @@
   });
 }
 
-void ASTDumper::VisitStmt(const Stmt *Node) {
-  {
-    ColorScope Color(OS, ShowColors, StmtColor);
-    OS << Node->getStmtClassName();
-  }
-  NodeDumper.dumpPointer(Node);
-  NodeDumper.dumpSourceRange(Node->getSourceRange());
-}
-
 void ASTDumper::VisitDeclStmt(const DeclStmt *Node) {
-  VisitStmt(Node);
   for (DeclStmt::const_decl_iterator I = Node->decl_begin(),
                                      E = Node->decl_end();
        I != E; ++I)
@@ -1722,7 +1717,6 @@
 }
 
 void ASTDumper::VisitAttributedStmt(const AttributedStmt *Node) {
-  VisitStmt(Node);
   for (ArrayRef<const Attr *>::iterator I = Node->getAttrs().begin(),
                                         E = Node->getAttrs().end();
        I != E; ++I)
@@ -1730,7 +1724,6 @@
 }
 
 void ASTDumper::VisitIfStmt(const IfStmt *Node) {
-  VisitStmt(Node);
   if (Node->hasInitStorage())
     OS << " has_init";
   if (Node->hasVarStorage())
@@ -1740,7 +1733,6 @@
 }
 
 void ASTDumper::VisitSwitchStmt(const SwitchStmt *Node) {
-  VisitStmt(Node);
   if (Node->hasInitStorage())
     OS << " has_init";
   if (Node->hasVarStorage())
@@ -1748,35 +1740,29 @@
 }
 
 void ASTDumper::VisitWhileStmt(const WhileStmt *Node) {
-  VisitStmt(Node);
   if (Node->hasVarStorage())
     OS << " has_var";
 }
 
 void ASTDumper::VisitLabelStmt(const LabelStmt *Node) {
-  VisitStmt(Node);
   OS << " '" << Node->getName() << "'";
 }
 
 void ASTDumper::VisitGotoStmt(const GotoStmt *Node) {
-  VisitStmt(Node);
   OS << " '" << Node->getLabel()->getName() << "'";
   NodeDumper.dumpPointer(Node->getLabel());
 }
 
 void ASTDumper::VisitCXXCatchStmt(const CXXCatchStmt *Node) {
-  VisitStmt(Node);
   dumpDecl(Node->getExceptionDecl());
 }
 
 void ASTDumper::VisitCaseStmt(const CaseStmt *Node) {
-  VisitStmt(Node);
   if (Node->caseStmtIsGNURange())
     OS << " gnu_range";
 }
 
 void ASTDumper::VisitCapturedStmt(const CapturedStmt *Node) {
-  VisitStmt(Node);
   dumpDecl(Node->getCapturedDecl());
 }
 
@@ -1786,7 +1772,6 @@
 
 void ASTDumper::VisitOMPExecutableDirective(
     const OMPExecutableDirective *Node) {
-  VisitStmt(Node);
   for (auto *C : Node->clauses()) {
     dumpChild([=] {
       if (!C) {
@@ -1815,7 +1800,6 @@
 //===----------------------------------------------------------------------===//
 
 void ASTDumper::VisitExpr(const Expr *Node) {
-  VisitStmt(Node);
   NodeDumper.dumpType(Node->getType());
 
   {
@@ -2241,7 +2225,6 @@
 }
 
 void ASTDumper::VisitObjCAtCatchStmt(const ObjCAtCatchStmt *Node) {
-  VisitStmt(Node);
   if (const VarDecl *CatchParam = Node->getCatchParamDecl())
     dumpDecl(CatchParam);
   else
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to