[cfe-commits] [PATCH] Utilize the indents in -ast-dump to draw structural information
Richard Trieu
rtrieu at google.com
Mon Jan 14 11:20:50 PST 2013
Use '`' instead of '\' when printing the tree structure. Example output:
(TranslationUnitDecl 0x6864660 <<invalid sloc>>
|-(TypedefDecl 0x6864ba0 <<invalid sloc>> __int128_t '__int128')
|-(TypedefDecl 0x6864c00 <<invalid sloc>> __uint128_t 'unsigned __int128')
|-(TypedefDecl 0x6864fc0 <<invalid sloc>> __builtin_va_list '__va_list_tag [1]')
`-(FunctionDecl 0x68651c0 <simple2.cc:1:1, line:5:1> main 'int (int, char **)'
|-(ParmVarDecl 0x6865020 <line:1:10, col:14> argc 'int')
|-(ParmVarDecl 0x68650f0 <col:20, col:27> argv 'char **')
`-(CompoundStmt 0x68918c0 <col:33, line:5:1>
|-(DeclStmt 0x68652f8 <line:2:3, col:12>
| `-(VarDecl 0x6865280 <col:3, col:11> x 'int'
| `-(IntegerLiteral 0x68652d8 <col:11> 'int' 5)))
|-(DeclStmt 0x68917c0 <line:3:3, col:12>
| `-(VarDecl 0x6865320 <col:3, col:11> y 'int'
| `-(IntegerLiteral 0x68917a0 <col:11> 'int' 2)))
`-(ReturnStmt 0x68918a0 <line:4:3, col:16>
`-(ParenExpr 0x6891880 <col:10, col:16> 'int'
`-(BinaryOperator 0x6891858 <col:11, col:15> 'int' '*'
|-(ImplicitCastExpr 0x6891828 <col:11> 'int' <LValueToRValue>
| `-(DeclRefExpr 0x68917d8 <col:11> 'int' lvalue Var 0x6865280 'x' 'int'))
`-(ImplicitCastExpr 0x6891840 <col:15> 'int' <LValueToRValue>
`-(DeclRefExpr 0x6891800 <col:15> 'int' lvalue Var 0x6865320 'y' 'int'))))))))
http://llvm-reviews.chandlerc.com/D281
CHANGE SINCE LAST DIFF
http://llvm-reviews.chandlerc.com/D281?vs=664&id=693#toc
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D281.2.patch
Type: text/x-patch
Size: 22205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130114/83510c33/attachment.bin>
More information about the cfe-commits
mailing list