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

Sean Silva silvas at purdue.edu
Thu Jan 10 18:35:46 PST 2013


Could you please attach an example of the output? It's hard to comment
on the format just by looking through the narrow lens of the FileCheck
assertions.

-- Sean Silva

On Thu, Jan 10, 2013 at 9:28 PM, Richard Trieu <rtrieu at google.com> wrote:
> Instead of printing spaces at the beginning of a line, use '|', '-' and '\' to display the tree.  This addition will make reading the AST easier, especially with line-spanning nodes.
>
> Indenting:
> Indenting is still handled by IndentScope.  Instead of an unsigned, a vector is used to track the indent status.  The vector is easily transformed to the proper output in indent().
>
> Last Child:
> Determining the last child of a node is important to printing the proper tree.  Each caller is responsible to call lastChild() before each possible last child.  In order to prevent multiple calls to lastChild() from messing up the indents, hasMoreChildren(true) can be called, which prevents the effects of lastChild() from taking effect.  hasMoreChildren(false) will allow lastChild() to work again.
>
> http://llvm-reviews.chandlerc.com/D281
>
> Files:
>   utils/TableGen/ClangAttrEmitter.cpp
>   lib/AST/ASTDumper.cpp
>   test/Misc/ast-dump-decl.c
>   test/Misc/ast-dump-attr.cpp
>   test/Misc/ast-dump-stmt.c
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>




More information about the cfe-commits mailing list