diff options
author | David Malcolm <dmalcolm@redhat.com> | 2020-03-17 10:25:14 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2020-03-18 09:51:50 -0400 |
commit | 0db2cd177020920e187ef47791d52cf689133a25 (patch) | |
tree | 3ff950a5c382103c9389efb2b36aa9e5c27cdebe /gcc/analyzer | |
parent | e5de406f9967ef4b0bbdbcbc0320869d2bf04558 (diff) | |
download | gcc-0db2cd177020920e187ef47791d52cf689133a25.zip gcc-0db2cd177020920e187ef47791d52cf689133a25.tar.gz gcc-0db2cd177020920e187ef47791d52cf689133a25.tar.bz2 |
analyzer: tweaks to exploded_node ctor
I have followup work that touches this, so it's easiest to get this
cleanup in first.
gcc/analyzer/ChangeLog:
* engine.cc (exploded_node::exploded_node): Move implementation
here from header; accept point_and_state by const reference rather
than by value.
* exploded-graph.h (exploded_node::exploded_node): Pass
point_and_state by const reference rather than by value. Move
body to engine.cc.
Diffstat (limited to 'gcc/analyzer')
-rw-r--r-- | gcc/analyzer/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/analyzer/engine.cc | 11 | ||||
-rw-r--r-- | gcc/analyzer/exploded-graph.h | 7 |
3 files changed, 21 insertions, 6 deletions
diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index a5c8b27..ace456c 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,12 @@ +2020-03-18 David Malcolm <dmalcolm@redhat.com> + + * engine.cc (exploded_node::exploded_node): Move implementation + here from header; accept point_and_state by const reference rather + than by value. + * exploded-graph.h (exploded_node::exploded_node): Pass + point_and_state by const reference rather than by value. Move + body to engine.cc. + 2020-03-18 Jakub Jelinek <jakub@redhat.com> * sm-malloc.cc (malloc_state_machine::on_stmt): Fix up duplicated word diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index a8037c6..369110b 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -795,6 +795,17 @@ print_enode_indices (pretty_printer *pp, } } +/* class exploded_node : public dnode<eg_traits>. */ + +/* exploded_node's ctor. */ + +exploded_node::exploded_node (const point_and_state &ps, + int index) +: m_ps (ps), m_status (STATUS_WORKLIST), m_index (index) +{ + gcc_checking_assert (ps.get_state ().m_region_model->canonicalized_p ()); +} + /* For use by dump_dot, get a value for the .dot "fillcolor" attribute. Colorize by sm-state, to make it easier to see how sm-state propagates through the exploded_graph. */ diff --git a/gcc/analyzer/exploded-graph.h b/gcc/analyzer/exploded-graph.h index c0a520a..b9a5618 100644 --- a/gcc/analyzer/exploded-graph.h +++ b/gcc/analyzer/exploded-graph.h @@ -175,12 +175,7 @@ class exploded_node : public dnode<eg_traits> STATUS_MERGER }; - exploded_node (point_and_state ps, - int index) - : m_ps (ps), m_status (STATUS_WORKLIST), m_index (index) - { - gcc_checking_assert (ps.get_state ().m_region_model->canonicalized_p ()); - } + exploded_node (const point_and_state &ps, int index); hashval_t hash () const { return m_ps.hash (); } |