From: Richard Smith Date: Tue, 3 Jun 2014 08:24:28 +0000 (+0000) Subject: Teach AST dumper to dump the array filler in an initializer list. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f05149680450b6543fc676987f601f359a86281f;p=platform%2Fupstream%2Fllvm.git Teach AST dumper to dump the array filler in an initializer list. llvm-svn: 210090 --- diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index 548e042..5709fb4 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -315,6 +315,7 @@ namespace { void VisitIntegerLiteral(const IntegerLiteral *Node); void VisitFloatingLiteral(const FloatingLiteral *Node); void VisitStringLiteral(const StringLiteral *Str); + void VisitInitListExpr(const InitListExpr *ILE); void VisitUnaryOperator(const UnaryOperator *Node); void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Node); void VisitMemberExpr(const MemberExpr *Node); @@ -1722,6 +1723,22 @@ void ASTDumper::VisitStringLiteral(const StringLiteral *Str) { Str->outputString(OS); } +void ASTDumper::VisitInitListExpr(const InitListExpr *ILE) { + VisitExpr(ILE); + if (auto *Filler = ILE->getArrayFiller()) { + if (!ILE->getNumInits()) + lastChild(); + IndentScope Indent(*this); + OS << "array filler"; + lastChild(); + dumpStmt(Filler); + } + if (auto *Field = ILE->getInitializedFieldInUnion()) { + OS << " field "; + dumpBareDeclRef(Field); + } +} + void ASTDumper::VisitUnaryOperator(const UnaryOperator *Node) { VisitExpr(Node); OS << " " << (Node->isPostfix() ? "postfix" : "prefix")