From 8f8c5d28dc6db7dc950ea126e9b801bc7c2c5c91 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 18 Jun 2020 07:50:23 -0400
Subject: [PATCH 236/237] FIXME: rename m_equiv_class2es to m_equiv_classes

---
 gcc/analyzer/constraint-manager2.cc | 92 ++++++++++++++---------------
 gcc/analyzer/constraint-manager2.h  |  6 +-
 2 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/gcc/analyzer/constraint-manager2.cc b/gcc/analyzer/constraint-manager2.cc
index 328321d2cc6..8f12cfcf51b 100644
--- a/gcc/analyzer/constraint-manager2.cc
+++ b/gcc/analyzer/constraint-manager2.cc
@@ -566,14 +566,14 @@ equiv_class2_id::print (pretty_printer *pp) const
 /* constraint_manager2's copy ctor.  */
 
 constraint_manager2::constraint_manager2 (const constraint_manager2 &other)
-: m_equiv_class2es (other.m_equiv_class2es.length ()),
+: m_equiv_classes (other.m_equiv_classes.length ()),
   m_constraints (other.m_constraints.length ()),
   m_mgr (other.m_mgr)
 {
   int i;
   equiv_class2 *ec;
-  FOR_EACH_VEC_ELT (other.m_equiv_class2es, i, ec)
-    m_equiv_class2es.quick_push (new equiv_class2 (*ec));
+  FOR_EACH_VEC_ELT (other.m_equiv_classes, i, ec)
+    m_equiv_classes.quick_push (new equiv_class2 (*ec));
   constraint2 *c;
   FOR_EACH_VEC_ELT (other.m_constraints, i, c)
     m_constraints.quick_push (*c);
@@ -584,14 +584,14 @@ constraint_manager2::constraint_manager2 (const constraint_manager2 &other)
 constraint_manager2&
 constraint_manager2::operator= (const constraint_manager2 &other)
 {
-  gcc_assert (m_equiv_class2es.length () == 0);
+  gcc_assert (m_equiv_classes.length () == 0);
   gcc_assert (m_constraints.length () == 0);
 
   int i;
   equiv_class2 *ec;
-  m_equiv_class2es.reserve (other.m_equiv_class2es.length ());
-  FOR_EACH_VEC_ELT (other.m_equiv_class2es, i, ec)
-    m_equiv_class2es.quick_push (new equiv_class2 (*ec));
+  m_equiv_classes.reserve (other.m_equiv_classes.length ());
+  FOR_EACH_VEC_ELT (other.m_equiv_classes, i, ec)
+    m_equiv_classes.quick_push (new equiv_class2 (*ec));
   constraint2 *c;
   m_constraints.reserve (other.m_constraints.length ());
   FOR_EACH_VEC_ELT (other.m_constraints, i, c)
@@ -610,7 +610,7 @@ constraint_manager2::hash () const
   equiv_class2 *ec;
   constraint2 *c;
 
-  FOR_EACH_VEC_ELT (m_equiv_class2es, i, ec)
+  FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
     hstate.merge_hash (ec->hash ());
   FOR_EACH_VEC_ELT (m_constraints, i, c)
     hstate.merge_hash (c->hash ());
@@ -622,7 +622,7 @@ constraint_manager2::hash () const
 bool
 constraint_manager2::operator== (const constraint_manager2 &other) const
 {
-  if (m_equiv_class2es.length () != other.m_equiv_class2es.length ())
+  if (m_equiv_classes.length () != other.m_equiv_classes.length ())
     return false;
   if (m_constraints.length () != other.m_constraints.length ())
     return false;
@@ -630,8 +630,8 @@ constraint_manager2::operator== (const constraint_manager2 &other) const
   int i;
   equiv_class2 *ec;
 
-  FOR_EACH_VEC_ELT (m_equiv_class2es, i, ec)
-    if (!(*ec == *other.m_equiv_class2es[i]))
+  FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
+    if (!(*ec == *other.m_equiv_classes[i]))
       return false;
 
   constraint2 *c;
@@ -651,7 +651,7 @@ constraint_manager2::print (pretty_printer *pp) const
   pp_string (pp, "{");
   int i;
   equiv_class2 *ec;
-  FOR_EACH_VEC_ELT (m_equiv_class2es, i, ec)
+  FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
     {
       if (i > 0)
 	pp_string (pp, ", ");
@@ -686,7 +686,7 @@ constraint_manager2::dump_to_pp (pretty_printer *pp, bool multiline) const
     pp_string (pp, " {");
   int i;
   equiv_class2 *ec;
-  FOR_EACH_VEC_ELT (m_equiv_class2es, i, ec)
+  FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
     {
       if (multiline)
 	pp_string (pp, "    ");
@@ -818,11 +818,11 @@ constraint_manager2::add_constraint (equiv_class2_id lhs_ec_id,
 
 	/* Drop rhs equivalence class, overwriting it with the
 	   final ec (which might be the same one).  */
-	equiv_class2_id final_ec_id = m_equiv_class2es.length () - 1;
-	equiv_class2 *old_ec = m_equiv_class2es[rhs_ec_id.m_idx];
-	equiv_class2 *final_ec = m_equiv_class2es.pop ();
+	equiv_class2_id final_ec_id = m_equiv_classes.length () - 1;
+	equiv_class2 *old_ec = m_equiv_classes[rhs_ec_id.m_idx];
+	equiv_class2 *final_ec = m_equiv_classes.pop ();
 	if (final_ec != old_ec)
-	  m_equiv_class2es[rhs_ec_id.m_idx] = final_ec;
+	  m_equiv_classes[rhs_ec_id.m_idx] = final_ec;
 	delete old_ec;
 
 	/* Update the constraints.  */
@@ -1023,7 +1023,7 @@ constraint_manager2::get_equiv_class2_by_svalue2 (const svalue2 *sval,
   /* TODO: should we have a map, rather than these searches?  */
   int i;
   equiv_class2 *ec;
-  FOR_EACH_VEC_ELT (m_equiv_class2es, i, ec)
+  FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
     {
       int j;
       const svalue2 *iv;
@@ -1057,7 +1057,7 @@ constraint_manager2::get_or_add_equiv_class2 (const svalue2 *sval)
     {
       int i;
       equiv_class2 *ec;
-      FOR_EACH_VEC_ELT (m_equiv_class2es, i, ec)
+      FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
 	if (ec->m_constant
 	    && types_compatible_p (TREE_TYPE (cst),
 				   TREE_TYPE (ec->m_constant)))
@@ -1076,9 +1076,9 @@ constraint_manager2::get_or_add_equiv_class2 (const svalue2 *sval)
   /* Not found.  */
   equiv_class2 *new_ec = new equiv_class2 ();
   new_ec->add (sval);
-  m_equiv_class2es.safe_push (new_ec);
+  m_equiv_classes.safe_push (new_ec);
 
-  equiv_class2_id new_id (m_equiv_class2es.length () - 1);
+  equiv_class2_id new_id (m_equiv_classes.length () - 1);
 
   if (sval->maybe_get_constant ())
     {
@@ -1332,9 +1332,9 @@ constraint_manager2::purge (const purge_criteria2 &p, purge_stats2 *stats)
 {
   /* Delete any svalue2_ids identified by P within the various equivalence
      classes.  */
-  for (unsigned ec_idx = 0; ec_idx < m_equiv_class2es.length (); )
+  for (unsigned ec_idx = 0; ec_idx < m_equiv_classes.length (); )
     {
-      equiv_class2 *ec = m_equiv_class2es[ec_idx];
+      equiv_class2 *ec = m_equiv_classes[ec_idx];
 
       int i;
       const svalue2 *pv;
@@ -1354,7 +1354,7 @@ constraint_manager2::purge (const purge_criteria2 &p, purge_stats2 *stats)
       if (delete_ec)
 	{
 	  delete ec;
-	  m_equiv_class2es.ordered_remove (ec_idx);
+	  m_equiv_classes.ordered_remove (ec_idx);
 	  if (stats)
 	    stats->m_num_equiv_classes++;
 
@@ -1390,8 +1390,8 @@ constraint_manager2::purge (const purge_criteria2 &p, purge_stats2 *stats)
   for (unsigned con_idx = 0; con_idx < m_constraints.length (); )
     {
       constraint2 *c = &m_constraints[con_idx];
-      if (m_equiv_class2es[c->m_lhs.m_idx]->m_vars.length () == 0
-	  && m_equiv_class2es[c->m_rhs.m_idx]->m_vars.length () == 0)
+      if (m_equiv_classes[c->m_lhs.m_idx]->m_vars.length () == 0
+	  && m_equiv_classes[c->m_rhs.m_idx]->m_vars.length () == 0)
 	{
 	  m_constraints.ordered_remove (con_idx);
 	  if (stats)
@@ -1405,9 +1405,9 @@ constraint_manager2::purge (const purge_criteria2 &p, purge_stats2 *stats)
 
   /* Finally, delete any ECs that purely contain constants and aren't
      referenced by any constraints.  */
-  for (unsigned ec_idx = 0; ec_idx < m_equiv_class2es.length (); )
+  for (unsigned ec_idx = 0; ec_idx < m_equiv_classes.length (); )
     {
-      equiv_class2 *ec = m_equiv_class2es[ec_idx];
+      equiv_class2 *ec = m_equiv_classes[ec_idx];
       if (ec->m_vars.length () == 0)
 	{
 	  equiv_class2_id ec_id (ec_idx);
@@ -1426,7 +1426,7 @@ constraint_manager2::purge (const purge_criteria2 &p, purge_stats2 *stats)
 	  if (!has_constraint)
 	    {
 	      delete ec;
-	      m_equiv_class2es.ordered_remove (ec_idx);
+	      m_equiv_classes.ordered_remove (ec_idx);
 	      if (stats)
 		stats->m_num_equiv_classes++;
 
@@ -1496,7 +1496,7 @@ constraint_manager2::canonicalize (unsigned num_svalue2_ids)
   /* First, sort svalue2_ids within the ECs.  */
   unsigned i;
   equiv_class2 *ec;
-  FOR_EACH_VEC_ELT (m_equiv_class2es, i, ec)
+  FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
     ec->canonicalize ();
 
   /* Next, sort the ECs into a canonical order.  */
@@ -1508,7 +1508,7 @@ constraint_manager2::canonicalize (unsigned num_svalue2_ids)
   auto_vec<equiv_class2_id> original_ec_id (num_svalue2_ids);
   for (i = 0; i < num_svalue2_ids; i++)
     original_ec_id.quick_push (equiv_class2_id::null ());
-  FOR_EACH_VEC_ELT (m_equiv_class2es, i, ec)
+  FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
     {
       svalue2_id rep = ec->get_representative ();
       gcc_assert (!rep.null_p ());
@@ -1516,11 +1516,11 @@ constraint_manager2::canonicalize (unsigned num_svalue2_ids)
     }
 
   /* Sort the equivalence classes.  */
-  m_equiv_class2es.qsort (equiv_class2_cmp);
+  m_equiv_classes.qsort (equiv_class2_cmp);
 
   /* Populate ec_id_map based on the old vs new EC ids.  */
-  one_way_id_map<equiv_class2_id> ec_id_map (m_equiv_class2es.length ());
-  FOR_EACH_VEC_ELT (m_equiv_class2es, i, ec)
+  one_way_id_map<equiv_class2_id> ec_id_map (m_equiv_classes.length ());
+  FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
     {
       svalue2_id rep = ec->get_representative ();
       ec_id_map.put (original_ec_id[rep.as_int ()], i);
@@ -1668,10 +1668,10 @@ clean_merger_input (const constraint_manager2 &cm_in,
 		    constraint_manager2 *out)
 {
   one_way_id_map<equiv_class2_id> map_ec_to_m
-    (cm_in.m_equiv_class2es.length ());
+    (cm_in.m_equiv_classes.length ());
   unsigned ec_idx;
   equiv_class2 *ec;
-  FOR_EACH_VEC_ELT (cm_in.m_equiv_class2es, ec_idx, ec)
+  FOR_EACH_VEC_ELT (cm_in.m_equiv_classes, ec_idx, ec)
     {
       equiv_class2 cleaned_ec;
       if (tree cst = ec->get_any_constant ())
@@ -1691,8 +1691,8 @@ clean_merger_input (const constraint_manager2 &cm_in,
 	}
       if (cleaned_ec.get_any_constant () || !cleaned_ec.m_vars.is_empty ())
 	{
-	  map_ec_to_m.put (ec_idx, out->m_equiv_class2es.length ());
-	  out->m_equiv_class2es.safe_push (new equiv_class2 (cleaned_ec));
+	  map_ec_to_m.put (ec_idx, out->m_equiv_classes.length ());
+	  out->m_equiv_classes.safe_push (new equiv_class2 (cleaned_ec));
 	}
     }
 
@@ -1725,7 +1725,7 @@ constraint_manager2::for_each_fact (fact2_visitor *visitor) const
   /* First, call EQ_EXPR within the various equivalence classes.  */
   unsigned ec_idx;
   equiv_class2 *ec;
-  FOR_EACH_VEC_ELT (m_equiv_class2es, ec_idx, ec)
+  FOR_EACH_VEC_ELT (m_equiv_classes, ec_idx, ec)
     {
       if (ec->m_cst_sval)
 	{
@@ -1777,7 +1777,7 @@ constraint_manager2::validate () const
 
   int i;
   equiv_class2 *ec;
-  FOR_EACH_VEC_ELT (m_equiv_class2es, i, ec)
+  FOR_EACH_VEC_ELT (m_equiv_classes, i, ec)
     {
       gcc_assert (ec);
 
@@ -1800,9 +1800,9 @@ constraint_manager2::validate () const
   FOR_EACH_VEC_ELT (m_constraints, i, c)
     {
       gcc_assert (!c->m_lhs.null_p ());
-      gcc_assert (c->m_lhs.as_int () <= (int)m_equiv_class2es.length ());
+      gcc_assert (c->m_lhs.as_int () <= (int)m_equiv_classes.length ());
       gcc_assert (!c->m_rhs.null_p ());
-      gcc_assert (c->m_rhs.as_int () <= (int)m_equiv_class2es.length ());
+      gcc_assert (c->m_rhs.as_int () <= (int)m_equiv_classes.length ());
     }
 }
 
@@ -2393,7 +2393,7 @@ test_constraint_impl ()
     /* Assert various things about the insides of model.  */
     constraint_manager2 *cm = model.get_constraints2 ();
     ASSERT_EQ (cm->m_constraints.length (), 0);
-    ASSERT_EQ (cm->m_equiv_class2es.length (), 1);
+    ASSERT_EQ (cm->m_equiv_classes.length (), 1);
   }
 
   /* y <= z; x == y.  */
@@ -2412,7 +2412,7 @@ test_constraint_impl ()
     /* Assert various things about the insides of model.  */
     constraint_manager2 *cm = model.get_constraints2 ();
     ASSERT_EQ (cm->m_constraints.length (), 1);
-    ASSERT_EQ (cm->m_equiv_class2es.length (), 2);
+    ASSERT_EQ (cm->m_equiv_classes.length (), 2);
 
     /* Ensure that we merged the constraints.  */
     ASSERT_CONDITION_TRUE2 (model, x, GE_EXPR, z);
@@ -2434,7 +2434,7 @@ test_constraint_impl ()
     /* Assert various things about the insides of model.  */
     constraint_manager2 *cm = model.get_constraints2 ();
     ASSERT_EQ (cm->m_constraints.length (), 1);
-    ASSERT_EQ (cm->m_equiv_class2es.length (), 2);
+    ASSERT_EQ (cm->m_equiv_classes.length (), 2);
 
     /* Ensure that we merged the constraints.  */
     ASSERT_CONDITION_TRUE2 (model, x, GE_EXPR, z);
@@ -2451,7 +2451,7 @@ test_constraint_impl ()
     /* Assert various things about the insides of model.  */
     constraint_manager2 *cm = model.get_constraints2 ();
     ASSERT_EQ (cm->m_constraints.length (), 0);
-    ASSERT_EQ (cm->m_equiv_class2es.length (), 1);
+    ASSERT_EQ (cm->m_equiv_classes.length (), 1);
 #if 0
     ASSERT_EQ (cm->m_constraints[0].m_lhs,
 	       cm->get_or_add_equiv_class2 (model.get_rvalue (int_0, NULL)));
diff --git a/gcc/analyzer/constraint-manager2.h b/gcc/analyzer/constraint-manager2.h
index b6cc0aef6fe..275ab262fe5 100644
--- a/gcc/analyzer/constraint-manager2.h
+++ b/gcc/analyzer/constraint-manager2.h
@@ -226,11 +226,11 @@ public:
 
   const equiv_class2 &get_equiv_class2_by_index (unsigned idx) const
   {
-    return *m_equiv_class2es[idx];
+    return *m_equiv_classes[idx];
   }
   equiv_class2 &get_equiv_class2_by_index (unsigned idx)
   {
-    return *m_equiv_class2es[idx];
+    return *m_equiv_classes[idx];
   }
 
   equiv_class2 &get_equiv_class2 (const svalue2 *sval)
@@ -272,7 +272,7 @@ public:
 
   void validate () const;
 
-  auto_delete_vec<equiv_class2> m_equiv_class2es;
+  auto_delete_vec<equiv_class2> m_equiv_classes;
   auto_vec<constraint2> m_constraints;
 
  private:
-- 
2.26.2

