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:
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
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
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
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
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
>
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 `{}`
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
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
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
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
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
12 matches
Mail list logo