diff options
author | David Malcolm <dmalcolm@redhat.com> | 2020-09-16 09:12:45 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2020-09-16 19:03:15 -0400 |
commit | d2c4d5199cf277becc1f377536973815d1c9519c (patch) | |
tree | 0015b37fdee4cc59fcce720e1996a6fd325ddefd | |
parent | b28491dc2d79763ecbff4f0b9f1f3e48a443be1d (diff) | |
download | gcc-d2c4d5199cf277becc1f377536973815d1c9519c.zip gcc-d2c4d5199cf277becc1f377536973815d1c9519c.tar.gz gcc-d2c4d5199cf277becc1f377536973815d1c9519c.tar.bz2 |
analyzer: show SCC ids in .dot dumps
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.
-rw-r--r-- | gcc/analyzer/engine.cc | 6 | ||||
-rw-r--r-- | gcc/analyzer/exploded-graph.h | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index 53fafb5..637a990 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -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; diff --git a/gcc/analyzer/exploded-graph.h b/gcc/analyzer/exploded-graph.h index 5d4c319..04e878f 100644 --- a/gcc/analyzer/exploded-graph.h +++ b/gcc/analyzer/exploded-graph.h @@ -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; |