[PATCH] D55495: Change InitListExpr dump to label and pointer

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 9 07:18:28 PST 2018


steveire created this revision.
steveire added a reviewer: aaron.ballman.
Herald added a subscriber: cfe-commits.

Don't add a child just for the label.


Repository:
  rC Clang

https://reviews.llvm.org/D55495

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


Index: test/AST/ast-dump-stmt.cpp
===================================================================
--- test/AST/ast-dump-stmt.cpp
+++ test/AST/ast-dump-stmt.cpp
@@ -90,9 +90,8 @@
 {
   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
 }
Index: lib/AST/ASTDumper.cpp
===================================================================
--- lib/AST/ASTDumper.cpp
+++ lib/AST/ASTDumper.cpp
@@ -1951,11 +1951,12 @@
     OS << " field ";
     NodeDumper.dumpBareDeclRef(Field);
   }
+
   if (auto *Filler = ILE->getArrayFiller()) {
-    dumpChild([=] {
-      OS << "array filler";
+      OS << " array_filler";
+      NodeDumper.dumpPointer(Filler);
+
       dumpStmt(Filler);
-    });
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55495.177426.patch
Type: text/x-patch
Size: 1215 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181209/fdf5e340/attachment-0001.bin>


More information about the cfe-commits mailing list