[cfe-commits] [PATCH] Utilize the indents in -ast-dump to draw structural information

Richard Trieu rtrieu at google.com
Thu Jan 24 19:43:04 PST 2013


  Responding to Phillip's comments.

  The new patch includes more context.  Unfortunately, diffs between patches don't work as well.  I will need to merge this with the color patch after I land that first.


================
Comment at: lib/AST/ASTDumper.cpp:40
@@ +39,3 @@
+
+    /// Indents - Indents[i] indicates if another child exists at level i.
+    /// Used by Indent() to print the tree structure. 
----------------
Philip Craig wrote:
> Don't put the name at the beginning of the comment.
Done.

================
Comment at: lib/AST/ASTDumper.cpp:541
@@ -445,1 +540,3 @@
+  setMoreChildren(HasDeclContext);
+  if (HasAttrs) {
     for (AttrVec::const_iterator I = D->getAttrs().begin(),
----------------
Philip Craig wrote:
> I think this test is some code I forgot to delete. The iterator check in the for loop is enough, so no need for this or the hasAttrs() call above.
I found that hasAttrs() is required.  getAttrs() asserts when there is no attrs.

================
Comment at: lib/AST/ASTDumper.cpp:549
@@ -448,2 +548,3 @@
   }
   // Decls within functions are visited by the body
+  setMoreChildren(false);
----------------
Philip Craig wrote:
> This comment might make more sense if it is moved up to HasDeclContext?
Done.

================
Comment at: lib/AST/ASTDumper.cpp:626
@@ -519,3 +625,3 @@
 
-  if (const FunctionTemplateSpecializationInfo *FTSI =
-      D->getTemplateSpecializationInfo())
+  bool oldMoreChildren = hasMoreChildren();
+  const FunctionTemplateSpecializationInfo *FTSI =
----------------
Philip Craig wrote:
> Use upper case for variables. Elsewhere too.
Done.  I think I got them all.


http://llvm-reviews.chandlerc.com/D281



More information about the cfe-commits mailing list