aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphclones.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2020-01-09 13:21:48 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2020-01-09 13:21:48 +0100
commit27c5a1779badd02b337af5887e26b5420fbf71c7 (patch)
tree1ad98f5766268743f658c44572a4cab09919fef9 /gcc/cgraphclones.c
parent87f9579a4f9934013b54f115740b7aaa247db58d (diff)
downloadgcc-27c5a1779badd02b337af5887e26b5420fbf71c7.zip
gcc-27c5a1779badd02b337af5887e26b5420fbf71c7.tar.gz
gcc-27c5a1779badd02b337af5887e26b5420fbf71c7.tar.bz2
Make cgraph_edge::resolve-speculation static
2020-01-09 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_edge): Make remove, set_call_stmt, make_direct, resolve_speculation and redirect_call_stmt_to_callee static. Change return type of set_call_stmt to cgraph_edge *. * auto-profile.c (afdo_indirect_call): Adjust call to redirect_call_stmt_to_callee. * cgraph.c (cgraph_edge::set_call_stmt): Make return cgraph-edge *, make the this pointer explicit, adjust self-recursive calls and the call top make_direct. Return the resulting edge. (cgraph_edge::remove): Make this pointer explicit. (cgraph_edge::resolve_speculation): Likewise, adjust call to remove. (cgraph_edge::make_direct): Likewise, adjust call to resolve_speculation. (cgraph_edge::redirect_call_stmt_to_callee): Likewise, also adjust call to set_call_stmt. (cgraph_update_edges_for_call_stmt_node): Update call to set_call_stmt and remove. * cgraphclones.c (cgraph_node::set_call_stmt_including_clones): Renamed edge to master_edge. Adjusted calls to set_call_stmt. (cgraph_node::create_edge_including_clones): Moved "first" definition of edge to the block where it was used. Adjusted calls to set_call_stmt. (cgraph_node::remove_symbol_and_inline_clones): Adjust call to cgraph_edge::remove. * cgraphunit.c (walk_polymorphic_call_targets): Adjusted calls to make_direct and redirect_call_stmt_to_callee. * ipa-fnsummary.c (redirect_to_unreachable): Adjust calls to resolve_speculation and make_direct. * ipa-inline-transform.c (inline_transform): Adjust call to redirect_call_stmt_to_callee. (check_speculations_1):: Adjust call to resolve_speculation. * ipa-inline.c (resolve_noninline_speculation): Adjust call to resolve-speculation. (inline_small_functions): Adjust call to resolve_speculation. (ipa_inline): Likewise. * ipa-prop.c (ipa_make_edge_direct_to_target): Adjust call to make_direct. * ipa-visibility.c (function_and_variable_visibility): Make iteration safe with regards to edge removal, adjust calls to redirect_call_stmt_to_callee. * ipa.c (walk_polymorphic_call_targets): Adjust calls to make_direct and redirect_call_stmt_to_callee. * multiple_target.c (create_dispatcher_calls): Adjust call to redirect_call_stmt_to_callee (redirect_to_specific_clone): Likewise. * tree-cfgcleanup.c (delete_unreachable_blocks_update_callgraph): Adjust calls to cgraph_edge::remove. * tree-inline.c (copy_bb): Adjust call to set_call_stmt. (redirect_all_calls): Adjust call to redirect_call_stmt_to_callee. (expand_call_inline): Adjust call to cgraph_edge::remove. From-SVN: r280043
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r--gcc/cgraphclones.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index 9b1cc3e..c186fb9 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -744,10 +744,10 @@ cgraph_node::set_call_stmt_including_clones (gimple *old_stmt,
bool update_speculative)
{
cgraph_node *node;
- cgraph_edge *edge = get_edge (old_stmt);
+ cgraph_edge *master_edge = get_edge (old_stmt);
- if (edge)
- edge->set_call_stmt (new_stmt, update_speculative);
+ if (master_edge)
+ cgraph_edge::set_call_stmt (master_edge, new_stmt, update_speculative);
node = clones;
if (node)
@@ -756,7 +756,8 @@ cgraph_node::set_call_stmt_including_clones (gimple *old_stmt,
cgraph_edge *edge = node->get_edge (old_stmt);
if (edge)
{
- edge->set_call_stmt (new_stmt, update_speculative);
+ edge = cgraph_edge::set_call_stmt (edge, new_stmt,
+ update_speculative);
/* If UPDATE_SPECULATIVE is false, it means that we are turning
speculative call into a real code sequence. Update the
callgraph edges. */
@@ -800,11 +801,10 @@ cgraph_node::create_edge_including_clones (cgraph_node *callee,
cgraph_inline_failed_t reason)
{
cgraph_node *node;
- cgraph_edge *edge;
if (!get_edge (stmt))
{
- edge = create_edge (callee, stmt, count);
+ cgraph_edge *edge = create_edge (callee, stmt, count);
edge->inline_failed = reason;
}
@@ -821,7 +821,7 @@ cgraph_node::create_edge_including_clones (cgraph_node *callee,
call in the clone or we are processing clones of unreachable
master where edges has been removed. */
if (edge)
- edge->set_call_stmt (stmt);
+ edge = cgraph_edge::set_call_stmt (edge, stmt);
else if (! node->get_edge (stmt))
{
edge = node->create_edge (callee, stmt, count);
@@ -855,7 +855,7 @@ cgraph_node::remove_symbol_and_inline_clones (cgraph_node *forbidden_node)
if (this == forbidden_node)
{
- callers->remove ();
+ cgraph_edge::remove (callers);
return true;
}
for (e = callees; e; e = next)