This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Yet another tree dumper



On Oct 10, 2003, at 11:17 AM, Jason Merrill wrote:


Why? The example Devang gave looks just as messy as the current dumper,
and doesn't have the <> brackets to mark boundaries.

If you use 90 char wide window then it you'll see it uses much better indentation scheme. And it adds empty lines also appropriately.

I only posted this patch, because people showed interest earlier...
[ see http://gcc.gnu.org/ml/gcc/2002-09/msg01249.html  thread]

Let's look at another example example functions with parameters.

<----------------------------------------------------------------------- ------------------------------------------------------------------------ ---------------------------------------------->
(gdb) call dmp_tree2(current_function_decl)
function_decl:0x40e296cc t=0x40e29658 {function_type} line=8(foo.c) pub initial=0x40ceac30
0x40e29740(0x40e294fc){0x40e19730} cntxt=0x40ce90e8 rtl=0x40e12e1c bar
result_decl:0x40e29740 t=0x40cf1910 {void} line=8
parm_decl:0x40e294fc t=0x40ce9488 {int} line=7 arg-type=0x40ce9488 as-written=0x40ce9488
cntxt=0x40e296cc i
parm_decl:0x40e29570 t=0x40ce932c {char} line=7 arg-type=0x40ce932c as-written=0x40ce932c
cntxt=0x40e296cc j
parm_decl:0x40e295e4 t=0x40cf1ae0 {float} line=7 arg-type=0x40cf1ae0 as-written=0x40cf1ae0
cntxt=0x40e296cc k
expr_stmt:0x40e19730 (dummy, to be deleted) 0x40e054c0


compound_stmt:0x40e19744 line=8 0x0

(gdb) call debug_tree(current_function_decl)
<function_decl 0x40e296cc bar
type <function_type 0x40e29658
type <void_type 0x40cf1910 void VOID
align 8 symtab 0 alias set -1
pointer_to_this <pointer_type 0x40cf1984>>
DI
size <integer_cst 0x40ce78a0 constant 64>
unit size <integer_cst 0x40ce7ac0 constant 8>
align 64 symtab 0 alias set -1
arg-types <tree_list 0x40e196b8 value <integer_type 0x40ce9488 int>
chain <tree_list 0x40e196cc value <integer_type 0x40ce932c char>
chain <tree_list 0x40e196e0 value <real_type 0x40cf1ae0 float>
chain <tree_list 0x40e196f4 value <void_type 0x40cf1910 void>>>>>>
public static asm-frame-size 0 SI file foo.c line 8 context <translation_unit_decl 0x40ce90e8>
arguments <parm_decl 0x40e294fc i
type <integer_type 0x40ce9488 int SI
size <integer_cst 0x40ce74e0 constant 32>
unit size <integer_cst 0x40ce7580 constant 4>
align 32 symtab 0 alias set -1 precision 32 min <integer_cst 0x40ce7540 -2147483648> max <integer_cst 0x40ce7560 2147483647>
pointer_to_this <pointer_type 0x40e06488>>
asm-frame-size 0 SI file foo.c line 7 size <integer_cst 0x40ce74e0 32> unit size <integer_cst 0x40ce7580 4>
align 32 context <function_decl 0x40e296cc bar> result <integer_type 0x40ce9488 int> initial <integer_type 0x40ce9488 int> arg-type <integer_type 0x40ce9488 int> arg-type-as-written <integer_type 0x40ce9488 int>
chain <parm_decl 0x40e29570 j type <integer_type 0x40ce932c char>
asm-frame-size 0 QI file foo.c line 7
size <integer_cst 0x40ce7380 constant 8>
unit size <integer_cst 0x40ce73a0 constant 1>
align 8 context <function_decl 0x40e296cc bar> result <integer_type 0x40ce932c char> initial <integer_type 0x40ce932c char> arg-type <integer_type 0x40ce932c char> arg-type-as-written <integer_type 0x40ce932c char> chain <parm_decl 0x40e295e4 k>>>
result <result_decl 0x40e29740 type <void_type 0x40cf1910 void>
asm-frame-size 0 VOID file foo.c line 8
align 8> initial <error_mark 0x40ceac30>
(mem:SI (symbol_ref:SI ("!T__bar")) [0 S4 A8]) chain <function_decl 0x40e2915c main>>


--
Devang


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]