From f62a346146884ffda3596c2d83bf867c5dd6e220 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 15 May 2020 09:37:37 -0400 Subject: [PATCH 136/179] FIXME: cleanups --- gcc/analyzer/region-model2.cc | 125 ---------------------------------- 1 file changed, 125 deletions(-) diff --git a/gcc/analyzer/region-model2.cc b/gcc/analyzer/region-model2.cc index 2caf5e421ea..e7b10f9f6cb 100644 --- a/gcc/analyzer/region-model2.cc +++ b/gcc/analyzer/region-model2.cc @@ -3354,7 +3354,6 @@ region_model2::dump_dot (const char *path) const } #endif - // FIXME: /* Dump a representation of this model to PP, showing the region2 hierarchy, the svalue2s, and any constraints. @@ -3369,7 +3368,6 @@ void region_model2::dump_to_pp (pretty_printer *pp, bool simple, bool multiline) const { -#if 1 /* Dump stack. */ pp_printf (pp, "stack depth: %i", get_stack_depth ()); if (multiline) @@ -3407,106 +3405,6 @@ region_model2::dump_to_pp (pretty_printer *pp, bool simple, m_constraints2->dump_to_pp (pp, multiline); if (!multiline) pp_string (pp, "}"); -#else - for (store_map_t::iterator iter = m_store_map.begin (); - iter != m_store_map.end (); ++iter) - { - if (iter != m_store_map.begin ()) - pp_string (pp, ", "); - region2 *reg = (*iter).first; - const svalue2 *sval = (*iter).second; - reg->dump_to_pp (pp, summarize); - pp_string (pp, ": "); - sval->dump_to_pp (pp, summarize); - } -#endif -#if 0 - if (summarize) - { - auto_vec rep_path_vars; - - unsigned i; - region2 *reg; - FOR_EACH_VEC_ELT (m_region2s, i, reg) - { - region2_id rid = region2_id::from_int (i); - path_var pv = get_representative_path_var (rid); - if (pv.m_tree) - rep_path_vars.safe_push (pv); - } - bool is_first = true; - - /* Work with a copy in case the get_lvalue calls change anything - (they shouldn't). */ - region_model2 copy (*this); - copy.dump_summary_of_rep_path_vars (pp, &rep_path_vars, &is_first); - - equiv_class *ec; - FOR_EACH_VEC_ELT (m_constraints->m_equiv_classes, i, ec) - { - for (unsigned j = 0; j < ec->m_vars.length (); j++) - { - svalue2_id lhs_sval = ec->m_vars[j]; - tree lhs_tree = get_representative_tree (lhs_sval); - if (lhs_tree == NULL_TREE) - continue; - for (unsigned k = j + 1; k < ec->m_vars.length (); k++) - { - svalue2_id rhs_sval = ec->m_vars[k]; - tree rhs_tree = get_representative_tree (rhs_sval); - if (rhs_tree - && !(CONSTANT_CLASS_P (lhs_tree) - && CONSTANT_CLASS_P (rhs_tree))) - { - dump_separator (pp, &is_first); - dump_tree (pp, lhs_tree); - pp_string (pp, " == "); - dump_tree (pp, rhs_tree); - } - } - } - } - - constraint *c; - FOR_EACH_VEC_ELT (m_constraints->m_constraints, i, c) - { - const equiv_class &lhs = c->m_lhs.get_obj (*m_constraints); - const equiv_class &rhs = c->m_rhs.get_obj (*m_constraints); - svalue2_id lhs_sval = lhs.get_representative (); - svalue2_id rhs_sval = rhs.get_representative (); - tree lhs_tree = get_representative_tree (lhs_sval); - tree rhs_tree = get_representative_tree (rhs_sval); - if (lhs_tree && rhs_tree - && !(CONSTANT_CLASS_P (lhs_tree) && CONSTANT_CLASS_P (rhs_tree))) - { - dump_separator (pp, &is_first); - dump_tree (pp, lhs_tree); - pp_printf (pp, " %s ", constraint_op_code (c->m_op)); - dump_tree (pp, rhs_tree); - } - } - - return; - } - - get_region2 (m_root_reg)->dump_to_pp (*this, m_root_reg, pp, "", true); - - pp_string (pp, "svalue2s:"); - pp_newline (pp); - int i; - const svalue2 *svalue2; - FOR_EACH_VEC_ELT (m_svalue2s, i, svalue2) - { - pp_string (pp, " "); - const svalue2 *sval = svalue2_id::from_int (i); - print_svalue2 (sid, pp); - pp_newline (pp); - } - - pp_string (pp, "constraint manager:"); - pp_newline (pp); - m_constraints->dump_to_pp (pp); -#endif } /* Dump a representation of this model to FILE. */ @@ -5170,29 +5068,6 @@ region_model2::get_store_value (const region2 *reg) return m_mgr->get_or_create_initial_value (reg); } -/* Return an svalue2 *for a pointer to RID of type PTR_TYPE, reusing - existing pointer values if one is available. */ -#if 0 -svalue2_id -region_model2::get_or_create_ptr_svalue2 (tree ptr_type, region2 *reg) -{ - /* Reuse existing region_svalue2, if one of the right type is - available. */ - /* In theory we could stash a svalue2 *in "region2", but differing - pointer types muddles things. - For now, just do a linear search through all existing svalue2s. */ - int i; - svalue2 *svalue2; - FOR_EACH_VEC_ELT (m_svalue2s, i, svalue2) - if (region_svalue2 *ptr_svalue2 = svalue2->dyn_cast_region_svalue2 ()) - if (ptr_svalue2->get_pointee () == rid - && ptr_svalue2->get_type () == ptr_type) - return svalue2_id::from_int (i); - - return add_svalue2 (new region_svalue2 (ptr_type, rid)); -} -#endif - /* Build a cast of SRC_EXPR to DST_TYPE, or return NULL_TREE. Adapted from gcc::jit::playback::context::build_cast, which in turn is -- 2.21.0