]> granicus.if.org Git - clang/commitdiff
Re-order content from InitListExpr
authorStephen Kelly <steveire@gmail.com>
Sun, 9 Dec 2018 13:15:18 +0000 (13:15 +0000)
committerStephen Kelly <steveire@gmail.com>
Sun, 9 Dec 2018 13:15:18 +0000 (13:15 +0000)
Summary:
This causes no change in the output of ast-dump-stmt.cpp due to the way
child nodes are printed with a delay.

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

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

lib/AST/ASTDumper.cpp

index bdbc562df77cf3b48e2e0fd636ccf2fddaab5e31..1ac604b17976181667e9998d3f1eb6e49ec3c4b9 100644 (file)
@@ -1979,16 +1979,16 @@ void ASTDumper::VisitStringLiteral(const StringLiteral *Str) {
 }
 
 void ASTDumper::VisitInitListExpr(const InitListExpr *ILE) {
+  if (auto *Field = ILE->getInitializedFieldInUnion()) {
+    OS << " field ";
+    NodeDumper.dumpBareDeclRef(Field);
+  }
   if (auto *Filler = ILE->getArrayFiller()) {
     dumpChild([=] {
       OS << "array filler";
       dumpStmt(Filler);
     });
   }
-  if (auto *Field = ILE->getInitializedFieldInUnion()) {
-    OS << " field ";
-    NodeDumper.dumpBareDeclRef(Field);
-  }
 }
 
 void ASTDumper::VisitUnaryOperator(const UnaryOperator *Node) {