]> granicus.if.org Git - clang/commitdiff
NFC: Inline handling of DependentSizedArrayType
authorStephen Kelly <steveire@gmail.com>
Wed, 5 Dec 2018 20:34:07 +0000 (20:34 +0000)
committerStephen Kelly <steveire@gmail.com>
Wed, 5 Dec 2018 20:34:07 +0000 (20:34 +0000)
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

index 8007282fe489a2457da42abd6faa4ad945a5fe77..069881f9e2237e7224bfe3ec3df60a26d4026be8 100644 (file)
@@ -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(