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]

[lto] Add dump_block_tree/debug_block_tree


Added while debugging BLOCK node streaming in the branch.  This
shows the tree of lexical bindings starting at a given block.  I
will commit on mainline after testing is finished.


2009-05-26  Diego Novillo  <dnovillo@google.com>

	* tree.c (dump_block_tree): New.
	(debug_block_tree): New.
	* tree.h (dump_block_tree): Declare.
	(debug_block_tree): Declare.

Index: tree.c
===================================================================
--- tree.c	(revision 147597)
+++ tree.c	(working copy)
@@ -10026,4 +10037,28 @@ list_equal_p (const_tree t1, const_tree 
 }
 
 
+/* Dump the tree of lexical bindings starting at BLOCK to FILE.  FLAGS
+   is as in print_generic_expr.  */
+
+void
+dump_block_tree (FILE *file, tree block, int flags)
+{
+  tree t;
+
+  print_generic_expr (file, block, flags);
+  fprintf (file, "\n");
+  for (t = BLOCK_SUBBLOCKS (block); t; t = BLOCK_CHAIN (t))
+    dump_block_tree (file, t, flags);
+}
+
+
+/* Dump the tree of lexical bindings starting at BLOCK to stderr.  FLAGS
+   is as in print_generic_expr.  */
+
+void
+debug_block_tree (tree block, int flags)
+{
+  dump_block_tree (stderr, block, flags);
+}
+
 #include "gt-tree.h"
Index: tree.h
===================================================================
--- tree.h	(revision 147597)
+++ tree.h	(working copy)
@@ -4659,6 +4659,8 @@ extern const char *get_name (tree);
 extern bool stdarg_p (tree);
 extern bool prototype_p (tree);
 extern bool auto_var_in_fn_p (const_tree, const_tree);
+extern void dump_block_tree (FILE *, tree, int);
+extern void debug_block_tree (tree, int);
 
 /* In gimplify.c */
 extern tree unshare_expr (tree);


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