From: David Malcolm Date: Thu, 30 Jan 2020 21:38:35 +0000 (-0500) Subject: analyzer: make extrinsic_state field private X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ebe9174e940c94e99cd688a05309833ae64a998b;p=gcc.git analyzer: make extrinsic_state field private gcc/analyzer/ChangeLog: * diagnostic-manager.cc (for_each_state_change): Use extrinsic_state::get_num_checkers rather than accessing m_checkers directly. * program-state.cc (program_state::program_state): Likewise. * program-state.h (extrinsic_state::m_checkers): Make private. --- diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index 1c981e4266b..9f2420624c0 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,11 @@ +2020-01-30 David Malcolm + + * diagnostic-manager.cc (for_each_state_change): Use + extrinsic_state::get_num_checkers rather than accessing m_checkers + directly. + * program-state.cc (program_state::program_state): Likewise. + * program-state.h (extrinsic_state::m_checkers): Make private. + 2020-01-30 David Malcolm PR analyzer/93356 diff --git a/gcc/analyzer/diagnostic-manager.cc b/gcc/analyzer/diagnostic-manager.cc index eb1fa05533e..023fda9fa7c 100644 --- a/gcc/analyzer/diagnostic-manager.cc +++ b/gcc/analyzer/diagnostic-manager.cc @@ -684,10 +684,10 @@ for_each_state_change (const program_state &src_state, state_change_visitor *visitor) { gcc_assert (src_state.m_checker_states.length () - == ext_state.m_checkers.length ()); + == ext_state.get_num_checkers ()); gcc_assert (dst_state.m_checker_states.length () - == ext_state.m_checkers.length ()); - for (unsigned i = 0; i < ext_state.m_checkers.length (); i++) + == ext_state.get_num_checkers ()); + for (unsigned i = 0; i < ext_state.get_num_checkers (); i++) { const state_machine &sm = ext_state.get_sm (i); const sm_state_map &src_smap = *src_state.m_checker_states[i]; diff --git a/gcc/analyzer/program-state.cc b/gcc/analyzer/program-state.cc index f41f105ce6b..ead62a5d423 100644 --- a/gcc/analyzer/program-state.cc +++ b/gcc/analyzer/program-state.cc @@ -535,9 +535,9 @@ sm_state_map::validate (const state_machine &sm, program_state::program_state (const extrinsic_state &ext_state) : m_region_model (new region_model ()), - m_checker_states (ext_state.m_checkers.length ()) + m_checker_states (ext_state.get_num_checkers ()) { - int num_states = ext_state.m_checkers.length (); + int num_states = ext_state.get_num_checkers (); for (int i = 0; i < num_states; i++) m_checker_states.quick_push (new sm_state_map ()); } diff --git a/gcc/analyzer/program-state.h b/gcc/analyzer/program-state.h index 0a4e35f3d5d..a052c6e8026 100644 --- a/gcc/analyzer/program-state.h +++ b/gcc/analyzer/program-state.h @@ -45,6 +45,7 @@ public: unsigned get_num_checkers () const { return m_checkers.length (); } +private: /* The state machines. */ auto_delete_vec &m_checkers; };