+2015-03-25 Martin Liska <mliska@suse.cz>
+
+ PR tree-optimization/65538
+ * symbol-summary.h (function_summary::~function_summary):
+ Relese memory for allocated summaries.
+ (function_summary::release): New function.
+
2015-03-25 Jakub Jelinek <jakub@redhat.com>
PR lto/65515
m_symtab_insertion_hook = NULL;
m_symtab_removal_hook = NULL;
m_symtab_duplication_hook = NULL;
+
+ /* Release all summaries. */
+ typedef typename hash_map <int, T *, summary_hashmap_traits>::iterator map_iterator;
+ for (map_iterator it = m_map.begin (); it != m_map.end (); ++it)
+ release ((*it).second);
}
/* Traverses all summarys with a function F called with
return m_ggc ? new (ggc_alloc <T> ()) T() : new T () ;
}
+ /* Release an item that is stored within map. */
+ void release (T *item)
+ {
+ if (m_ggc)
+ {
+ item->~T ();
+ ggc_free (item);
+ }
+ else
+ delete item;
+ }
+
/* Getter for summary callgraph node pointer. */
T* get (cgraph_node *node)
{