analyzer: show SCC ids in .dot dumps
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 16 Sep 2020 13:12:45 +0000 (09:12 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Wed, 16 Sep 2020 23:03:15 +0000 (19:03 -0400)
gcc/analyzer/ChangeLog:
* engine.cc (supernode_cluster::dump_dot): Show the SCC id
in the per-supernode clusters in FILENAME.eg.dot output.
(exploded_graph_annotator::add_node_annotations):
Show the SCC of the supernode in FILENAME.supernode.eg.dot output.
* exploded-graph.h (worklist::scc_id): New.
(exploded_graph::get_scc_id): New.

gcc/analyzer/engine.cc
gcc/analyzer/exploded-graph.h

index 53fafb58633cd8380247b6129a4b0137c883b99b..637a990da4a9b26cb90708aee4ca5bbcfaf85565 100644 (file)
@@ -3288,8 +3288,9 @@ public:
                 (const void *)this);
     gv->indent ();
     gv->println ("style=\"dashed\";");
-    gv->println ("label=\"SN: %i (bb: %i)\";",
-                m_supernode->m_index, m_supernode->m_bb->index);
+    gv->println ("label=\"SN: %i (bb: %i; scc: %i)\";",
+                m_supernode->m_index, m_supernode->m_bb->index,
+                args.m_eg.get_scc_id (*m_supernode));
 
     int i;
     exploded_node *enode;
@@ -4040,6 +4041,7 @@ public:
 
     gv->begin_td ();
     pp_string (pp, "BEFORE");
+    pp_printf (pp, " (scc: %i)", m_eg.get_scc_id (n));
     gv->end_td ();
 
     unsigned i;
index 5d4c3190283ff99712d03ad5b6135367db0d0149..04e878fbdfc1ce59d86d498df0325c4d05a907f6 100644 (file)
@@ -652,6 +652,10 @@ public:
   exploded_node *take_next ();
   exploded_node *peek_next ();
   void add_node (exploded_node *enode);
+  int get_scc_id (const supernode &snode) const
+  {
+    return m_scc.get_scc_id (snode.m_index);
+  }
 
 private:
   class key_t
@@ -783,6 +787,11 @@ public:
   const call_string_data_map_t *get_per_call_string_data () const
   { return &m_per_call_string_data; }
 
+  int get_scc_id (const supernode &node) const
+  {
+    return m_worklist.get_scc_id (node);
+  }
+
 private:
   void print_bar_charts (pretty_printer *pp) const;