From 78cd68c0af1ba80b29849712f8defe51fd232ee7 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 29 Oct 2019 14:52:42 +0100 Subject: Release function and edge summaries allocated with GGC. 2019-10-29 Martin Liska * ggc.h (ggc_alloc_no_dtor): New function. * ipa-fnsummary.c (ipa_free_fn_summary): Call destructor and ggc_free. (ipa_free_size_summary): Call delete instead of release. * ipa-fnsummary.h: Use new function ggc_alloc_no_dtor. * ipa-prop.c (ipa_check_create_edge_args): Likewise. (ipa_free_all_edge_args): Call destructor and ggc_free. (ipa_free_all_node_params): Likewise. (ipcp_free_transformation_sum): Likewise. * ipa-prop.h (ipa_check_create_node_params): Call new ggc_alloc_no_dtor. * ipa-sra.c (ipa_sra_generate_summary): Likewise. (ipa_sra_analysis): Call destructor and ggc_free. Replace release with delete operator. * symbol-summary.h (release): Remove .. (V>::~fast_function_summary): and move logic here. Likewise for other classes. From-SVN: r277572 --- gcc/ggc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc/ggc.h') diff --git a/gcc/ggc.h b/gcc/ggc.h index 64d1f18..d5735d0 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -185,6 +185,18 @@ ggc_alloc (ALONE_CXX_MEM_STAT_INFO) PASS_MEM_STAT)); } +/* GGC allocation function that does not call finalizer for type + that have need_finalization_p equal to true. User is responsible + for calling of the destructor. */ + +template +inline T * +ggc_alloc_no_dtor (ALONE_CXX_MEM_STAT_INFO) +{ + return static_cast (ggc_internal_alloc (sizeof (T), NULL, 0, 1 + PASS_MEM_STAT)); +} + template inline T * ggc_cleared_alloc (ALONE_CXX_MEM_STAT_INFO) -- cgit v1.1