From a8a68a9e4f3d6e76a7c11236883a52c99f0f34a4 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Fri, 26 Jul 2019 20:32:24 -0400
Subject: [PATCH 33/33] FIXME: cleanups

---
 gcc/analyzer/impl-4.cc | 63 ++++++++++++++++++++++++++++----------------------
 1 file changed, 36 insertions(+), 27 deletions(-)

diff --git a/gcc/analyzer/impl-4.cc b/gcc/analyzer/impl-4.cc
index 956f4cf..16d775a 100644
--- a/gcc/analyzer/impl-4.cc
+++ b/gcc/analyzer/impl-4.cc
@@ -2099,7 +2099,7 @@ private:
 
 ////////////////////////////////////////////////////////////////////////////
 
-/* FIXME.  */
+/* Subclass of diagnostic_path for analyzer diagnostics.  */
 
 class checker4_path : public diagnostic_path
 {
@@ -2198,7 +2198,7 @@ public:
 
 /* class call_string.  */
 
-/* FIXME.  */
+/* call_string's copy ctor.  */
 
 call_string::call_string (const call_string &other)
 : m_return_edges (other.m_return_edges.length ())
@@ -2209,7 +2209,7 @@ call_string::call_string (const call_string &other)
     m_return_edges.quick_push (e);
 }
 
-/* FIXME.  */
+/* call_string's assignment operator.  */
 
 call_string&
 call_string::operator= (const call_string &other)
@@ -2224,7 +2224,7 @@ call_string::operator= (const call_string &other)
   return *this;
 }
 
-/* FIXME.  */
+/* call_string's equality operator.  */
 
 bool
 call_string::operator== (const call_string &other) const
@@ -2239,7 +2239,7 @@ call_string::operator== (const call_string &other) const
   return true;
 }
 
-/* FIXME.  */
+/* Print this to PP.  */
 
 void
 call_string::print (pretty_printer *pp) const
@@ -2260,7 +2260,7 @@ call_string::print (pretty_printer *pp) const
   pp_string (pp, "]");
 }
 
-/* FIXME.  */
+/* Create a std::string for this call_string.  */
 
 std::string
 call_string::to_str () const
@@ -2270,7 +2270,7 @@ call_string::to_str () const
   return std::string (pp_formatted_text (&pp));
 }
 
-/* FIXME.  */
+/* Generate a hash value for this call_string.  */
 
 hashval_t
 call_string::hash () const
@@ -2283,7 +2283,8 @@ call_string::hash () const
   return hstate.end ();
 }
 
-/* FIXME.  */
+/* Push the return superedge for CALL_SEDGE onto the end of this
+   call_string.  */
 
 void
 call_string::push_call (const supergraph &sg,
@@ -2380,7 +2381,7 @@ call_string::cmp_1 (const call_string &a,
 
 ////////////////////////////////////////////////////////////////////////////
 
-/* FIXME.  */
+/* Print this program_point to PP.  */
 
 void
 program_point::print (pretty_printer *pp, const format &f) const
@@ -2452,7 +2453,7 @@ public:
   }
 };
 
-/* FIXME.  */
+/* Print the source line (if any) for this program_point to PP.  */
 
 void
 program_point::print_source_line (pretty_printer *pp) const
@@ -2467,7 +2468,7 @@ program_point::print_source_line (pretty_printer *pp) const
   pp_string (pp, pp_formatted_text (tmp_dc.printer));
 }
 
-/* FIXME.  */
+/* Generate a std::string for this program_point.  */
 
 std::string
 program_point::to_str (const format &f) const
@@ -2477,7 +2478,7 @@ program_point::to_str (const format &f) const
   return std::string (pp_formatted_text (&pp));
 }
 
-/* FIXME.  */
+/* Generate a hash value for this program_point.  */
 
 hashval_t
 program_point::hash () const
@@ -2492,7 +2493,7 @@ program_point::hash () const
   return hstate.end ();
 }
 
-/* FIXME.  */
+/* Get the gimple stmt for this program_point, if any.  */
 
 const gimple *
 program_point::get_stmt () const
@@ -2688,7 +2689,7 @@ sm_state_map::clone_with_remapping (const one_way_svalue_id_map &id_map) const
   return result;
 }
 
-/* FIXME.  */
+/* Print this sm_state_map (for SM) to PP.  */
 
 void
 sm_state_map::print (const state_machine &sm, pretty_printer *pp) const
@@ -2711,7 +2712,7 @@ sm_state_map::print (const state_machine &sm, pretty_printer *pp) const
   pp_string (pp, "}");
 }
 
-/* FIXME.  */
+/* Dump this object (for SM) to stderr.  */
 
 DEBUG_FUNCTION void
 sm_state_map::dump (const state_machine &sm) const
@@ -2724,7 +2725,7 @@ sm_state_map::dump (const state_machine &sm) const
   pp_flush (&pp);
 }
 
-/* FIXME.  */
+/* Generate a std::string for this object.  */
 
 std::string
 sm_state_map::to_str (const state_machine &sm) const
@@ -2734,7 +2735,8 @@ sm_state_map::to_str (const state_machine &sm) const
   return std::string (pp_formatted_text (&pp));
 }
 
-/* FIXME.  */
+/* Return true if no states have been set within this map
+   (all expressions are for the start state).  */
 
 bool
 sm_state_map::is_empty_p () const
@@ -2742,7 +2744,7 @@ sm_state_map::is_empty_p () const
   return m_map.elements () == 0;
 }
 
-/* FIXME.  */
+/* Generate a hash value for this sm_state_map.  */
 
 hashval_t
 sm_state_map::hash () const
@@ -2762,7 +2764,7 @@ sm_state_map::hash () const
   return hstate.end ();
 }
 
-/* FIXME.  */
+/* Equality operator for sm_state_map.  */
 
 bool
 sm_state_map::operator== (const sm_state_map &other) const
@@ -2786,7 +2788,9 @@ sm_state_map::operator== (const sm_state_map &other) const
   return true;
 }
 
-/* FIXME.  */
+/* Get the state of SID within this object.
+   States default to the start state.  */
+
 state_machine::state_t
 sm_state_map::get_state (svalue_id sid) const
 {
@@ -2797,7 +2801,7 @@ sm_state_map::get_state (svalue_id sid) const
     return 0;
 }
 
-/* FIXME.  */
+/* Get the "origin" svalue_id for any state of SID.  */
 
 svalue_id
 sm_state_map::get_origin (svalue_id sid) const
@@ -2808,7 +2812,8 @@ sm_state_map::get_origin (svalue_id sid) const
   return slot->m_origin;
 }
 
-/* FIXME.  */
+/* Set the state of SID within MODEL to STATE, recording that
+   the state came from ORIGIN.  */
 
 void
 sm_state_map::set_state (region_model *model,
@@ -2822,7 +2827,8 @@ sm_state_map::set_state (region_model *model,
   set_state (ec, state, origin);
 }
 
-/* FIXME.  */
+/* Set the state of EC to STATE, recording that the state came from
+   ORIGIN.  */
 
 void
 sm_state_map::set_state (const equiv_class &ec,
@@ -2903,7 +2909,7 @@ sm_state_map::purge_for_unknown_fncall (const exploded_graph &eg,
     }
 }
 
-/* FIXME.  */
+/* Update this map based on MAP.  */
 
 void
 sm_state_map::remap_svalue_ids (const svalue_id_map &map)
@@ -2938,7 +2944,10 @@ sm_state_map::remap_svalue_ids (const svalue_id_map &map)
     }
 }
 
-/* FIXME.  */
+/* Purge any state for svalue_ids >= FIRST_UNUSED_SID.
+   If !SM::can_purge_p, then report the state as leaking,
+   using SM_IDX, CTXT, and MAP.
+   Return the number of states that were purged.  */
 
 int
 sm_state_map::on_svalue_purge (const state_machine &sm,
@@ -2988,7 +2997,7 @@ sm_state_map::on_svalue_purge (const state_machine &sm,
   return to_remove.length ();
 }
 
-/* FIXME.  */
+/* Set the state of CHILD_SID to that of PARENT_SID.  */
 
 void
 sm_state_map::on_inherited_svalue (svalue_id parent_sid,
@@ -2998,7 +3007,7 @@ sm_state_map::on_inherited_svalue (svalue_id parent_sid,
   impl_set_state (child_sid, state, parent_sid);
 }
 
-/* FIXME.  */
+/* Assert that this object is sane.  */
 
 void
 sm_state_map::validate (const state_machine &sm,
-- 
1.8.5.3

