aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-11-18 17:39:23 +0100
committerMartin Liska <mliska@suse.cz>2021-11-18 19:34:11 +0100
commit616ca1024a79c6a1935ea152051b9016d2142fb6 (patch)
tree177437845d9094f3aff80b4a101697df973ec166 /gcc
parent53c964ad996a1bb22566b987eafb333b5899deab (diff)
downloadgcc-616ca1024a79c6a1935ea152051b9016d2142fb6.zip
gcc-616ca1024a79c6a1935ea152051b9016d2142fb6.tar.gz
gcc-616ca1024a79c6a1935ea152051b9016d2142fb6.tar.bz2
IPA: use cgraph_node instance
gcc/ChangeLog: * ipa-modref.c (analyze_function): Use fnode instead of repeated cgraph_node::get (current_function_decl).
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ipa-modref.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index e5d2b11..2c507cc 100644
--- a/gcc/ipa-modref.c
+++ b/gcc/ipa-modref.c
@@ -2882,22 +2882,22 @@ analyze_function (function *f, bool ipa)
{
if (dump_file
&& (summary
- = optimization_summaries->get (cgraph_node::get (f->decl)))
+ = optimization_summaries->get (fnode))
!= NULL
&& summary->loads)
{
fprintf (dump_file, "Past summary:\n");
optimization_summaries->get
- (cgraph_node::get (f->decl))->dump (dump_file);
+ (fnode)->dump (dump_file);
past_flags.reserve_exact (summary->arg_flags.length ());
past_flags.splice (summary->arg_flags);
past_retslot_flags = summary->retslot_flags;
past_static_chain_flags = summary->static_chain_flags;
past_flags_known = true;
}
- optimization_summaries->remove (cgraph_node::get (f->decl));
+ optimization_summaries->remove (fnode);
}
- summary = optimization_summaries->get_create (cgraph_node::get (f->decl));
+ summary = optimization_summaries->get_create (fnode);
gcc_checking_assert (nolto && !lto);
}
/* In IPA mode we analyze every function precisely once. Assert that. */
@@ -2908,16 +2908,16 @@ analyze_function (function *f, bool ipa)
if (!summaries)
summaries = modref_summaries::create_ggc (symtab);
else
- summaries->remove (cgraph_node::get (f->decl));
- summary = summaries->get_create (cgraph_node::get (f->decl));
+ summaries->remove (fnode);
+ summary = summaries->get_create (fnode);
}
if (lto)
{
if (!summaries_lto)
summaries_lto = modref_summaries_lto::create_ggc (symtab);
else
- summaries_lto->remove (cgraph_node::get (f->decl));
- summary_lto = summaries_lto->get_create (cgraph_node::get (f->decl));
+ summaries_lto->remove (fnode);
+ summary_lto = summaries_lto->get_create (fnode);
}
if (!fnspec_summaries)
fnspec_summaries = new fnspec_summaries_t (symtab);
@@ -3036,13 +3036,11 @@ analyze_function (function *f, bool ipa)
{
if (!summary->loads->every_base && !summary->loads->bases
&& !summary->calls_interposable)
- fixup_cfg = ipa_make_function_const
- (cgraph_node::get (current_function_decl),
- summary->side_effects, true);
+ fixup_cfg = ipa_make_function_const (fnode,
+ summary->side_effects, true);
else
- fixup_cfg = ipa_make_function_pure
- (cgraph_node::get (current_function_decl),
- summary->side_effects, true);
+ fixup_cfg = ipa_make_function_pure (fnode,
+ summary->side_effects, true);
}
}
if (summary && !summary->useful_p (ecf_flags))