analyzer: make extrinsic_state field private
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 30 Jan 2020 21:38:35 +0000 (16:38 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 31 Jan 2020 00:24:06 +0000 (19:24 -0500)
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.

gcc/analyzer/ChangeLog
gcc/analyzer/diagnostic-manager.cc
gcc/analyzer/program-state.cc
gcc/analyzer/program-state.h

index 1c981e4266b66212ac945c9c49c7617d134f535f..9f2420624c0bb0b9bd3d94f7c2ed573139889394 100644 (file)
@@ -1,3 +1,11 @@
+2020-01-30  David Malcolm  <dmalcolm@redhat.com>
+
+       * 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  <dmalcolm@redhat.com>
 
        PR analyzer/93356
index eb1fa05533ebe8fb559e2a1333d07726d1b87fc8..023fda9fa7cb7989646f84ea2384f4e2f587baef 100644 (file)
@@ -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];
index f41f105ce6b06acf40741e090d41f61260100c31..ead62a5d423813d24099016970e6c57963e66ef2 100644 (file)
@@ -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 ());
 }
index 0a4e35f3d5d34b01b7a8d136ec275f3767ffff25..a052c6e80266acbf2c978ab3da9ef26a642f63da 100644 (file)
@@ -45,6 +45,7 @@ public:
 
   unsigned get_num_checkers () const { return m_checkers.length (); }
 
+private:
   /* The state machines.  */
   auto_delete_vec <state_machine> &m_checkers;
 };