From 7d2cb2755a14b95b1d71c3e52895d75954b4ec47 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Fri, 2 Oct 2020 18:41:34 +0200 Subject: ipa: Introduce ipa_cached_call_context Hi, as we discussed with Honza on the mailin glist last week, making cached call context structure distinct from the normal one may make it clearer that the cached data need to be explicitely deallocated. This patch does that division. It is not mandatory for the overall main goals of the patch set and can be dropped if deemed superfluous. gcc/ChangeLog: 2020-09-02 Martin Jambor * ipa-fnsummary.h (ipa_cached_call_context): New forward declaration and class. (class ipa_call_context): Make friend ipa_cached_call_context. Moved methods duplicate_from and release to it too. * ipa-fnsummary.c (ipa_call_context::duplicate_from): Moved to class ipa_cached_call_context. (ipa_call_context::release): Likewise, removed the parameter. * ipa-inline-analysis.c (node_context_cache_entry): Change the type of ctx to ipa_cached_call_context. (do_estimate_edge_time): Remove parameter from the call to ipa_cached_call_context::release. --- gcc/ipa-inline-analysis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/ipa-inline-analysis.c') diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index d2ae819..b7af77f 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -57,7 +57,7 @@ fast_call_summary *edge_growth_cache = NULL; class node_context_cache_entry { public: - ipa_call_context ctx; + ipa_cached_call_context ctx; sreal time, nonspec_time; int size; ipa_hints hints; @@ -226,7 +226,7 @@ do_estimate_edge_time (struct cgraph_edge *edge, sreal *ret_nonspec_time) node_context_cache_miss++; else node_context_cache_clear++; - e->entry.ctx.release (true); + e->entry.ctx.release (); ctx.estimate_size_and_time (&size, &min_size, &time, &nonspec_time, &hints); e->entry.size = size; -- cgit v1.1