diff mbox series

[pushed] rtl-ssa: Add debug routines for def_splay_tree

Message ID mpta5i94ej6.fsf@arm.com
State New
Headers show
Series [pushed] rtl-ssa: Add debug routines for def_splay_tree | expand

Commit Message

Richard Sandiford July 22, 2024, 3:44 p.m. UTC
This patch adds debug routines for def_splay_tree, which I found
useful while debugging PR116009.

Bootstrapped & regression-tested on aarch64-linux-gnu.  Pushed as
(hopefully) obvious.

Richard


gcc/
	* rtl-ssa/accesses.h (rtl_ssa::pp_def_splay_tree): Declare.
	(dump, debug): Add overloads for def_splay_tree.
	* rtl-ssa/accesses.cc (rtl_ssa::pp_def_splay_tree): New function.
	(dump, debug): Add overloads for def_splay_tree.
---
 gcc/rtl-ssa/accesses.cc | 15 +++++++++++++++
 gcc/rtl-ssa/accesses.h  |  3 +++
 2 files changed, 18 insertions(+)
diff mbox series

Patch

diff --git a/gcc/rtl-ssa/accesses.cc b/gcc/rtl-ssa/accesses.cc
index 5cc05cb4be7..c77a1ff7ea7 100644
--- a/gcc/rtl-ssa/accesses.cc
+++ b/gcc/rtl-ssa/accesses.cc
@@ -1745,6 +1745,13 @@  rtl_ssa::pp_def_lookup (pretty_printer *pp, def_lookup dl)
   pp_def_mux (pp, dl.mux);
 }
 
+// Print TREE to PP.
+void
+rtl_ssa::pp_def_splay_tree (pretty_printer *pp, def_splay_tree tree)
+{
+  tree.print (pp, pp_def_node);
+}
+
 // Dump RESOURCE to FILE.
 void
 dump (FILE *file, resource_info resource)
@@ -1787,6 +1794,13 @@  dump (FILE *file, def_lookup result)
   dump_using (file, pp_def_lookup, result);
 }
 
+// Print TREE to FILE.
+void
+dump (FILE *file, def_splay_tree tree)
+{
+  dump_using (file, pp_def_splay_tree, tree);
+}
+
 // Debug interfaces to the dump routines above.
 void debug (const resource_info &x) { dump (stderr, x); }
 void debug (const access_info *x) { dump (stderr, x); }
@@ -1794,3 +1808,4 @@  void debug (const access_array &x) { dump (stderr, x); }
 void debug (const def_node *x) { dump (stderr, x); }
 void debug (const def_mux &x) { dump (stderr, x); }
 void debug (const def_lookup &x) { dump (stderr, x); }
+void debug (const def_splay_tree &x) { dump (stderr, x); }
diff --git a/gcc/rtl-ssa/accesses.h b/gcc/rtl-ssa/accesses.h
index 27810a02063..7d0d7bcfb50 100644
--- a/gcc/rtl-ssa/accesses.h
+++ b/gcc/rtl-ssa/accesses.h
@@ -1052,6 +1052,7 @@  void pp_accesses (pretty_printer *, access_array,
 void pp_def_node (pretty_printer *, const def_node *);
 void pp_def_mux (pretty_printer *, def_mux);
 void pp_def_lookup (pretty_printer *, def_lookup);
+void pp_def_splay_tree (pretty_printer *, def_splay_tree);
 
 }
 
@@ -1063,6 +1064,7 @@  void dump (FILE *, rtl_ssa::access_array,
 void dump (FILE *, const rtl_ssa::def_node *);
 void dump (FILE *, rtl_ssa::def_mux);
 void dump (FILE *, rtl_ssa::def_lookup);
+void dump (FILE *, rtl_ssa::def_splay_tree);
 
 void DEBUG_FUNCTION debug (const rtl_ssa::resource_info *);
 void DEBUG_FUNCTION debug (const rtl_ssa::access_info *);
@@ -1070,3 +1072,4 @@  void DEBUG_FUNCTION debug (const rtl_ssa::access_array);
 void DEBUG_FUNCTION debug (const rtl_ssa::def_node *);
 void DEBUG_FUNCTION debug (const rtl_ssa::def_mux &);
 void DEBUG_FUNCTION debug (const rtl_ssa::def_lookup &);
+void DEBUG_FUNCTION debug (const rtl_ssa::def_splay_tree &);