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]

[tree-ssa] tree debugging hook


Invaluable when searching for constructs being rewritten.


r~


        * tree-inline.c (debug_find_tree_1, debug_find_tree): New.

Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.26.2.43
diff -c -p -d -r1.26.2.43 tree-inline.c
*** tree-inline.c	25 Aug 2003 20:52:18 -0000	1.26.2.43
--- tree-inline.c	17 Sep 2003 23:36:56 -0000
*************** lhd_unsave_expr_now (tree expr)
*** 1951,1953 ****
--- 1951,1971 ----
  
    return expr;
  }
+ 
+ /* Allow someone to determine if SEARCH is a child of TOP from gdb.  */
+ static tree
+ debug_find_tree_1 (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, void *data)
+ {
+   if (*tp == data)
+     return (tree) data;
+   else
+     return NULL;
+ }
+ 
+ extern bool debug_find_tree (tree top, tree search);
+ 
+ bool
+ debug_find_tree (tree top, tree search)
+ {
+   return walk_tree_without_duplicates (&top, debug_find_tree_1, search) != 0;
+ }


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