[ASTDump] Add utility for dumping a label with child nodes
authorStephen Kelly <steveire@gmail.com>
Fri, 11 Jan 2019 19:11:17 +0000 (19:11 +0000)
committerStephen Kelly <steveire@gmail.com>
Fri, 11 Jan 2019 19:11:17 +0000 (19:11 +0000)
commit0df805db731fa1384c36f18a50b4ec35cbf368f4
treeab903a3323209fd202018a1913f0f0c47f54334d
parent27ba55914addfd55c9b6e5fa73aae51246424ef2
[ASTDump] Add utility for dumping a label with child nodes

Summary:
Use it to add optional label nodes to Stmt dumps.  This preserves
behavior of InitExprList dump:

// CHECK-NEXT: `-InitListExpr {{.+}} <col:13, col:15> 'U [3]'
// CHECK-NEXT:   |-array_filler: InitListExpr {{.+}} <col:15> 'U' field Field {{.+}} 'i' 'int'
// CHECK-NEXT:   `-InitListExpr {{.+}} <col:14> 'U' field Field {{.+}} 'i' 'int'
// CHECK-NEXT:     `-IntegerLiteral {{.+}} <col:14> 'int' 1

Reviewers: aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D55488

llvm-svn: 350957
clang/include/clang/AST/TextNodeDumper.h
clang/lib/AST/ASTDumper.cpp
clang/test/AST/ast-dump-stmt.cpp