+2015-04-17 Martin Liska <mliska@suse.cz>
+
+ * ipa-icf.c (sem_item_optimizer::subdivide_classes_by_sensitive_refs):
+ Release symbol_compare_collection.
+ * ipa-reference.c: Add TODO that a vector should be released.
+
2015-04-17 Sivanupandi Pitchumani <Pitchumani.Sivanupandi@atmel.com>
PR target/65296
unsigned
sem_item_optimizer::subdivide_classes_by_sensitive_refs ()
{
+ typedef hash_map <symbol_compare_collection *, vec <sem_item *>,
+ symbol_compare_hashmap_traits> subdivide_hash_map;
+
unsigned newly_created_classes = 0;
for (hash_table <congruence_class_group_hash>::iterator it = m_classes.begin ();
if (c->members.length() > 1)
{
- hash_map <symbol_compare_collection *, vec <sem_item *>,
- symbol_compare_hashmap_traits> split_map;
+ subdivide_hash_map split_map;
for (unsigned j = 0; j < c->members.length (); j++)
{
symbol_compare_collection *collection = new symbol_compare_collection (source_node->node);
- vec <sem_item *> *slot = &split_map.get_or_insert (collection);
+ bool existed;
+ vec <sem_item *> *slot = &split_map.get_or_insert (collection,
+ &existed);
gcc_checking_assert (slot);
slot->safe_push (source_node);
+
+ if (existed)
+ delete collection;
}
/* If the map contains more than one key, we have to split the map
{
bool first_class = true;
- hash_map <symbol_compare_collection *, vec <sem_item *>,
- symbol_compare_hashmap_traits>::iterator it2 = split_map.begin ();
- for (; it2 != split_map.end (); ++it2)
+ for (subdivide_hash_map::iterator it2 = split_map.begin ();
+ it2 != split_map.end (); ++it2)
{
congruence_class *new_cls;
new_cls = new congruence_class (class_id++);
}
}
}
+
+ /* Release memory. */
+ for (subdivide_hash_map::iterator it2 = split_map.begin ();
+ it2 != split_map.end (); ++it2)
+ {
+ delete (*it2).first;
+ (*it2).second.release ();
+ }
}
}
Indexed by UID of call graph nodes. */
static vec<ipa_reference_vars_info_t> ipa_reference_vars_vector;
+/* TODO: find a place where we should release the vector. */
static vec<ipa_reference_optimization_summary_t> ipa_reference_opt_sum_vector;
/* Return the ipa_reference_vars structure starting from the cgraph NODE. */