[PATCH] D56642: NFC: Move dump of type nodes to NodeDumper

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 14 06:31:59 PST 2019


steveire marked an inline comment as done.
steveire added inline comments.


================
Comment at: lib/AST/ASTDumper.cpp:145
     void VisitVariableArrayType(const VariableArrayType *T) {
-      OS << " ";
-      NodeDumper.dumpSourceRange(T->getBracketsRange());
-      VisitArrayType(T);
+      dumpTypeAsChild(T->getElementType());
       dumpStmt(T->getSizeExpr());
----------------
aaron.ballman wrote:
> Why this approach instead of deferring to `VisitArrayType()` as before? I prefer calling the Visit function rather than reimplementing the functionality because we may decide to later improve the base class printing and expect subclasses to automatically pick that up. WDYT?
I think it's more clear to read what each visit method does, but I don't feel strongly about it. I can change this if you do.


Repository:
  rC Clang

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

https://reviews.llvm.org/D56642





More information about the cfe-commits mailing list