diff options
author | Jason Merrill <jason@redhat.com> | 2013-07-13 19:10:29 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-07-13 19:10:29 -0400 |
commit | 286e8fc16fb582ee1cb3869aafb87309542a55ec (patch) | |
tree | cab820c1ef6dae755bb84387aba1007c79765bee /gcc/print-tree.c | |
parent | 16b53405ad2baba783cf7ecf34a623fd64db2dda (diff) | |
download | gcc-286e8fc16fb582ee1cb3869aafb87309542a55ec.zip gcc-286e8fc16fb582ee1cb3869aafb87309542a55ec.tar.gz gcc-286e8fc16fb582ee1cb3869aafb87309542a55ec.tar.bz2 |
print-tree.c (debug_vec_tree): Use debug_raw.
* print-tree.c (debug_vec_tree): Use debug_raw.
(debug_raw (vec<tree, va_gc> &)): New.
(debug_raw (vec<tree, va_gc> *)): New.
* tree.h: Declare them.
From-SVN: r200940
Diffstat (limited to 'gcc/print-tree.c')
-rw-r--r-- | gcc/print-tree.c | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/gcc/print-tree.c b/gcc/print-tree.c index 689eeb9..029c3a2 100644 --- a/gcc/print-tree.c +++ b/gcc/print-tree.c @@ -1097,26 +1097,37 @@ debug_body (const tree_node *ptr) down to a depth of six. */ DEBUG_FUNCTION void -debug_vec_tree (vec<tree, va_gc> *vec) +debug_raw (vec<tree, va_gc> &ref) { tree elt; unsigned ix; /* Print the slot this node is in, and its code, and address. */ fprintf (stderr, "<VEC"); - dump_addr (stderr, " ", vec->address ()); + dump_addr (stderr, " ", ref.address ()); - FOR_EACH_VEC_ELT (*vec, ix, elt) + FOR_EACH_VEC_ELT (ref, ix, elt) { fprintf (stderr, "elt %d ", ix); - debug (elt); + debug_raw (elt); } } DEBUG_FUNCTION void debug (vec<tree, va_gc> &ref) { - debug_vec_tree (&ref); + tree elt; + unsigned ix; + + /* Print the slot this node is in, and its code, and address. */ + fprintf (stderr, "<VEC"); + dump_addr (stderr, " ", ref.address ()); + + FOR_EACH_VEC_ELT (ref, ix, elt) + { + fprintf (stderr, "elt %d ", ix); + debug (elt); + } } DEBUG_FUNCTION void @@ -1127,3 +1138,18 @@ debug (vec<tree, va_gc> *ptr) else fprintf (stderr, "<nil>\n"); } + +DEBUG_FUNCTION void +debug_raw (vec<tree, va_gc> *ptr) +{ + if (ptr) + debug_raw (*ptr); + else + fprintf (stderr, "<nil>\n"); +} + +DEBUG_FUNCTION void +debug_vec_tree (vec<tree, va_gc> *vec) +{ + debug_raw (vec); +} |