[committed] analyzer: show BBs in .dot dumps

Message ID 20200203194229.11113-1-dmalcolm@redhat.com
State New
Headers show
Series
  • [committed] analyzer: show BBs in .dot dumps
Related show

Commit Message

David Malcolm Feb. 3, 2020, 7:42 p.m.
I found this useful whilst debugging PR analyzer/93544

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to master as 73f386581bddc4d630b93eeb0cddd32943bf24e7.

gcc/analyzer/ChangeLog:
	* engine.cc (supernode_cluster::dump_dot): Show BB index as
	well as SN index.
	* supergraph.cc (supernode::dump_dot): Likewise.
---
 gcc/analyzer/engine.cc     | 3 ++-
 gcc/analyzer/supergraph.cc | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.21.0

Patch

diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc
index 9acec704224..66ca37ea33b 100644
--- a/gcc/analyzer/engine.cc
+++ b/gcc/analyzer/engine.cc
@@ -2811,7 +2811,8 @@  public:
 		 (const void *)this);
     gv->indent ();
     gv->println ("style=\"dashed\";");
-    gv->println ("label=\"SN: %i\";", m_supernode->m_index);
+    gv->println ("label=\"SN: %i (bb: %i)\";",
+		 m_supernode->m_index, m_supernode->m_bb->index);
 
     int i;
     exploded_node *enode;
diff --git a/gcc/analyzer/supergraph.cc b/gcc/analyzer/supergraph.cc
index a5bf52d8aca..b20daa081d2 100644
--- a/gcc/analyzer/supergraph.cc
+++ b/gcc/analyzer/supergraph.cc
@@ -437,7 +437,7 @@  supernode::dump_dot (graphviz_out *gv, const dump_args_t &args) const
   gv->println("style=\"solid\";");
   gv->println("color=\"black\";");
   gv->println("fillcolor=\"lightgrey\";");
-  gv->println("label=\"sn: %i\";", m_index);
+  gv->println("label=\"sn: %i (bb: %i)\";", m_index, m_bb->index);
 
   pretty_printer *pp = gv->get_pp ();