]> granicus.if.org Git - clang/commitdiff
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348794 91177308-0d34-0410-b5e6-96231b3b80d8

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

index e071575a1ea4a981cda15ebaf19d1d6fdf44ce3b..1a79137adb6c387e3b51f043c3e5e75408c1d03b 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 671bdd64544b988449e6de266e1a574ede148288..8548da72d1afe11e50b5df4596addeeb4fc61148 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
 }