Author: steveire
Date: Wed Dec  5 12:34:07 2018
New Revision: 348409

URL: http://llvm.org/viewvc/llvm-project?rev=348409&view=rev
Log:
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

Modified:
    cfe/trunk/lib/AST/ASTDumper.cpp

Modified: cfe/trunk/lib/AST/ASTDumper.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=348409&r1=348408&r2=348409&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Wed Dec  5 12:34:07 2018
@@ -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(


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to