[PATCH] D55488: Add utility for dumping a label with child nodes

2019-01-11 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC350957: [ASTDump] Add utility for dumping a label with child nodes (authored by steveire, committed by ). Changed prior to commit: https://reviews.llvm.org/D55488?vs=180935&id=181331#toc Repository:

[PATCH] D55488: Add utility for dumping a label with child nodes

2019-01-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. Aside from cosmetic nits, this LGTM. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55488/new/ https://reviews.llvm.org/D55488

[PATCH] D55488: Add utility for dumping a label with child nodes

2019-01-09 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 180935. steveire added a comment. Nits Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55488/new/ https://reviews.llvm.org/D55488 Files: include/clang/AST/TextNodeDumper.h lib/AST/ASTDumper.cpp test/AST/ast-dump-stmt.cp

[PATCH] D55488: Add utility for dumping a label with child nodes

2019-01-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. @rsmith -- do you have opinions on the new format for how we display the child node? I think this is a more clear approach, but a second opinion would be nice. Comment at: include/clang/AST/TextNodeDumper.h:43 + /// Add a child of the current no

[PATCH] D55488: Add utility for dumping a label with child nodes

2019-01-08 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 180754. steveire added a comment. Replace std::string with StringRef Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55488/new/ https://reviews.llvm.org/D55488 Files: include/clang/AST/TextNodeDumper.h lib/AST/ASTDumper.c

[PATCH] D55488: Add utility for dumping a label with child nodes

2018-12-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: lib/AST/ASTDumper.cpp:89 void dumpDecl(const Decl *D); -void dumpStmt(const Stmt *S); +void dumpStmt(const Stmt *S, const std::string &label = {}); steveire wrote: > aaron.ballman wrote: > > Label >

[PATCH] D55488: Add utility for dumping a label with child nodes

2018-12-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: lib/AST/ASTDumper.cpp:89 void dumpDecl(const Decl *D); -void dumpStmt(const Stmt *S); +void dumpStmt(const Stmt *S, const std::string &label = {}); aaron.ballman wrote: > Label > > Rather than using `{}`

[PATCH] D55488: Add utility for dumping a label with child nodes

2018-12-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 177595. steveire added a comment. Clean up API a bit. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55488/new/ https://reviews.llvm.org/D55488 Files: include/clang/AST/ASTDumperUtils.h lib/AST/ASTDumper.cpp test/AST/a

[PATCH] D55488: Add utility for dumping a label with child nodes

2018-12-10 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 177594. steveire marked an inline comment as done. steveire added a comment. Update with new approach Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55488/new/ https://reviews.llvm.org/D55488 Files: include/clang/AST/ASTDu

[PATCH] D55488: Add utility for dumping a label with child nodes

2018-12-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/AST/ASTDumperUtils.h:115 + template + void addChild(const std::string &label, Fn doAddChild) { +if (label.empty()) label -> Label doAddChild -> DoAddChild Comment at: include

[PATCH] D55488: Add utility for dumping a label with child nodes

2018-12-09 Thread Stephen Kelly via Phabricator via cfe-commits
steveire updated this revision to Diff 177419. steveire added a comment. Use std::string Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55488/new/ https://reviews.llvm.org/D55488 Files: include/clang/AST/ASTDumperUtils.h lib/AST/ASTDumper.cpp Index: lib/AST

[PATCH] D55488: Add utility for dumping a label with child nodes

2018-12-09 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. Herald added a subscriber: cfe-commits. Use it to add optional label nodes to Stmt dumps. This preserves behavior of InitExprList dump: // CHECK-NEXT: `-InitListExpr {{.+}} 'U [3]' // CHECK-NEXT: |-array filler // CHECK