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 : Part 2 (2/4)


2nd alternative is to use #define USE_NEW_TREE_DUMPER to select
tree dumper.

2003-10-17 Devang Patel <dpatel@apple.com>

        * print-tree.c (debug_tree_old): Rename debug_tree()
        (debug_tree): New function to call debug_tree_old() or
        dmp_tree2().
        * tree.h (USE_NEW_TREE_DUMPER): New.

--
Devang

Index: print-tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/print-tree.c,v
retrieving revision 1.79
diff -Idpatel.pbxuser -c -3 -p -r1.79 print-tree.c
*** print-tree.c        22 Sep 2003 05:09:12 -0000      1.79
--- print-tree.c        17 Oct 2003 18:43:57 -0000
*************** static struct bucket **table;
*** 46,53 ****
     Most nodes referred to by this one are printed recursively
     down to a depth of six.  */

  void
! debug_tree (tree node)
  {
    table = xcalloc (HASH_SIZE, sizeof (struct bucket *));
    print_node (stderr, "", node, 0);
--- 46,63 ----
     Most nodes referred to by this one are printed recursively
     down to a depth of six.  */

+ extern void dmp_tree2 (tree node);
+ void debug_tree (tree node)
+ {
+ #if defined(USE_NEW_TREE_DUMPER)
+   dmp_tree2 (node);
+ #else
+   debug_tree_old (node);
+ #endif
+ }
+
  void
! debug_tree_old (tree node)
  {
    table = xcalloc (HASH_SIZE, sizeof (struct bucket *));
    print_node (stderr, "", node, 0);
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.448
diff -Idpatel.pbxuser -c -3 -p -r1.448 tree.h
*** tree.h      9 Oct 2003 05:44:51 -0000       1.448
--- tree.h      17 Oct 2003 18:43:57 -0000
*************** typedef enum
*** 3102,3106 ****

  extern int tree_node_counts[];
  extern int tree_node_sizes[];
!
  #endif  /* GCC_TREE_H  */
--- 3102,3108 ----

  extern int tree_node_counts[];
  extern int tree_node_sizes[];
!
! #define USE_NEW_TREE_DUMPER 1
!
  #endif  /* GCC_TREE_H  */


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