aboutsummaryrefslogtreecommitdiff
path: root/gcc/vec.h
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-02-18 09:21:23 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-02-18 08:21:23 +0000
commitdb30281f0b2ff6dfc0c4146291baf020a27e4065 (patch)
tree419ecfa282d86cfaa3d74625e4883e4a619573c9 /gcc/vec.h
parente8cecccc2e5abb5d753291892968bf72533a7045 (diff)
downloadgcc-db30281f0b2ff6dfc0c4146291baf020a27e4065.zip
gcc-db30281f0b2ff6dfc0c4146291baf020a27e4065.tar.gz
gcc-db30281f0b2ff6dfc0c4146291baf020a27e4065.tar.bz2
Come up with fast {function,call}_summary classes (PR ipa/89306).
2019-02-18 Martin Liska <mliska@suse.cz> PR ipa/89306 * cgraph.c (symbol_table::create_edge): Set m_summary_id to -1 by default. (symbol_table::free_edge): Recycle m_summary_id. * cgraph.h (get_summary_id): New. (symbol_table::release_symbol): Set m_summary_id to -1 by default. (symbol_table::allocate_cgraph_symbol): Recycle m_summary_id. * ipa-fnsummary.c (ipa_fn_summary_t): Switch from function_summary to fast_function_summary. * ipa-fnsummary.h (ipa_fn_summary_t): Likewise. * ipa-pure-const.c (class funct_state_summary_t): Switch from function_summary to fast_function_summary. * ipa-reference.c (class ipa_ref_var_info_summary_t): Likewise. (class ipa_ref_opt_summary_t): Switch from function_summary to fast_function_summary. * symbol-summary.h (class function_summary_base): New class that is created from base of former function_summary. (function_summary_base::unregister_hooks): New. (class function_summary): Inherit from function_summary_base. (class call_summary_base): New class that is created from base of former call_summary. (class call_summary): Inherit from call_summary_base. (struct is_same): New. (class fast_function_summary): New summary class. (class fast_call_summary): New summary class. * vec.h (vec_safe_grow_cleared): New function. From-SVN: r268979
Diffstat (limited to 'gcc/vec.h')
-rw-r--r--gcc/vec.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/vec.h b/gcc/vec.h
index 8c2a39b..4bd9df9 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -732,6 +732,17 @@ vec_safe_grow_cleared (vec<T, A, vl_embed> *&v, unsigned len CXX_MEM_STAT_INFO)
}
+/* Assume V is not NULL. */
+
+template<typename T>
+inline void
+vec_safe_grow_cleared (vec<T, va_heap, vl_ptr> *&v,
+ unsigned len CXX_MEM_STAT_INFO)
+{
+ v->safe_grow_cleared (len);
+}
+
+
/* If V is NULL return false, otherwise return V->iterate(IX, PTR). */
template<typename T, typename A>
inline bool