From a1ae28d5e6db6f761b082e7b36940b4fbf671e08 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 5 Dec 2018 20:34:07 +0000 Subject: [PATCH] NFC: Inline handling of DependentSizedArrayType Summary: Re-order handling of getElementType and getBracketsRange. It is necessary to perform all printing before any traversal to child nodes. This causes no change in the output of ast-dump-array.cpp due to the way child nodes are printed with a delay. This new order of the code is also the order that produces the expected output anyway. Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55257 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348409 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ASTDumper.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index 8007282fe4..069881f9e2 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -299,9 +299,15 @@ namespace { dumpStmt(T->getSizeExpr()); } void VisitDependentSizedArrayType(const DependentSizedArrayType *T) { - VisitArrayType(T); + switch (T->getSizeModifier()) { + case ArrayType::Normal: break; + case ArrayType::Static: OS << " static"; break; + case ArrayType::Star: OS << " *"; break; + } + OS << " " << T->getIndexTypeQualifiers().getAsString(); OS << " "; dumpSourceRange(T->getBracketsRange()); + dumpTypeAsChild(T->getElementType()); dumpStmt(T->getSizeExpr()); } void VisitDependentSizedExtVectorType( -- 2.50.1