ipa: Introduce ipa_cached_call_context
authorMartin Jambor <mjambor@suse.cz>
Fri, 2 Oct 2020 16:41:34 +0000 (18:41 +0200)
committerMartin Jambor <mjambor@suse.cz>
Fri, 2 Oct 2020 16:41:34 +0000 (18:41 +0200)
commit7d2cb2755a14b95b1d71c3e52895d75954b4ec47
tree657e2cce680ff6d0a25cb4c0dfd0f5f825b70d12
parent9d5af1db2d1e7ca4f47f16fc885e1d70fa0229fc
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  <mjambor@suse.cz>

* 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-fnsummary.c
gcc/ipa-fnsummary.h
gcc/ipa-inline-analysis.c