[PATCH] D55257: Inline handling of DependentSizedArrayType

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 4 02:00:54 PST 2018


steveire created this revision.
Herald added a subscriber: cfe-commits.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D55257

Files:
  lib/AST/ASTDumper.cpp


Index: lib/AST/ASTDumper.cpp
===================================================================
--- lib/AST/ASTDumper.cpp
+++ lib/AST/ASTDumper.cpp
@@ -299,9 +299,15 @@
       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(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55257.176563.patch
Type: text/x-patch
Size: 767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181204/e880d400/attachment.bin>


More information about the cfe-commits mailing list