[PATCH] D55068: NFC: Simplify dumpStmt child handling

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 30 05:35:26 PST 2018


aaron.ballman added inline comments.


================
Comment at: lib/AST/ASTDumper.cpp:1987
 
+    ConstStmtVisitor<ASTDumper>::Visit(S);
+
----------------
steveire wrote:
> aaron.ballman wrote:
> > Was there something special about calling the Visit methods directly and bailing out? Your code certainly looks reasonable, but I wonder if the output is changed because it goes through the `ConstStmtVisitor` instead of directly dispatching.
> I don't think it could have changed. By my understanding of the `StmtVisitor`, this has the same effect.
Yeah, I don't see how it would either, but the original code smells suspicious to me. How about adding some tests for DeclStmt and GenericSelectionExpr that demonstrates explicitly this isn't changing behavior?

In fact, it seems that we have some bugs in this area (with DeclStmt) already, so understanding what's changing may point out fixes. https://godbolt.org/z/tDJ-0H


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55068/new/

https://reviews.llvm.org/D55068





More information about the cfe-commits mailing list