summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2018-12-05 20:34:07 +0000
committerStephen Kelly <steveire@gmail.com>2018-12-05 20:34:07 +0000
commitec42aa036c19b0a161d2d9c0eb6b8e5a75e3ed62 (patch)
treec7e2102487635b69c9d4c785a193c162dd142396 /clang/lib/AST
parent9f358871d52baa9115e44b68fa53219332a89428 (diff)
downloadbcm5719-llvm-ec42aa036c19b0a161d2d9c0eb6b8e5a75e3ed62.tar.gz
bcm5719-llvm-ec42aa036c19b0a161d2d9c0eb6b8e5a75e3ed62.zip
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 llvm-svn: 348409
Diffstat (limited to 'clang/lib/AST')
-rw-r--r--clang/lib/AST/ASTDumper.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp
index 8007282fe48..069881f9e22 100644
--- a/clang/lib/AST/ASTDumper.cpp
+++ b/clang/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(
OpenPOWER on IntegriCloud