Change InitListExpr dump to label and pointer
authorStephen Kelly <steveire@gmail.com>
Mon, 10 Dec 2018 20:53:32 +0000 (20:53 +0000)
committerStephen Kelly <steveire@gmail.com>
Mon, 10 Dec 2018 20:53:32 +0000 (20:53 +0000)
Summary: Don't add a child just for the label.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 348794

clang/lib/AST/ASTDumper.cpp
clang/test/AST/ast-dump-stmt.cpp

index e071575..1a79137 100644 (file)
@@ -1951,11 +1951,12 @@ void ASTDumper::VisitInitListExpr(const InitListExpr *ILE) {
     OS << " field ";
     NodeDumper.dumpBareDeclRef(Field);
   }
+
   if (auto *Filler = ILE->getArrayFiller()) {
-    dumpChild([=] {
-      OS << "array filler";
-      dumpStmt(Filler);
-    });
+    OS << " array_filler";
+    NodeDumper.dumpPointer(Filler);
+
+    dumpStmt(Filler);
   }
 }
 
index 671bdd6..8548da7 100644 (file)
@@ -90,9 +90,8 @@ void TestUnionInitList()
 {
   U us[3] = {1};
 // CHECK: VarDecl {{.+}} <col:3, col:15> col:5 us 'U [3]' cinit
-// CHECK-NEXT: `-InitListExpr {{.+}} <col:13, col:15> 'U [3]'
-// CHECK-NEXT:   |-array filler
-// CHECK-NEXT:   | `-InitListExpr {{.+}} <col:15> 'U' field Field {{.+}} 'i' 'int'
+// CHECK-NEXT: `-InitListExpr {{.+}} <col:13, col:15> 'U [3]' array_filler 0x{{.+}}
+// CHECK-NEXT:   |-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
 }