diff options
author | Martin Jambor <mjambor@suse.cz> | 2020-01-09 13:21:48 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2020-01-09 13:21:48 +0100 |
commit | 27c5a1779badd02b337af5887e26b5420fbf71c7 (patch) | |
tree | 1ad98f5766268743f658c44572a4cab09919fef9 /gcc/cgraph.h | |
parent | 87f9579a4f9934013b54f115740b7aaa247db58d (diff) | |
download | gcc-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/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index c5cee22..71cd902 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -1736,13 +1736,15 @@ public: friend struct cgraph_node; friend class symbol_table; - /* Remove the edge in the cgraph. */ - void remove (void); + /* Remove EDGE from the cgraph. */ + static void remove (cgraph_edge *edge); - /* Change field call_stmt of edge to NEW_STMT. - If UPDATE_SPECULATIVE and E is any component of speculative - edge, then update all components. */ - void set_call_stmt (gcall *new_stmt, bool update_speculative = true); + /* Change field call_stmt of edge E to NEW_STMT. If UPDATE_SPECULATIVE and E + is any component of speculative edge, then update all components. + Speculations can be resolved in the process and EDGE can be removed and + deallocated. Return the edge that now represents the call. */ + static cgraph_edge *set_call_stmt (cgraph_edge *e, gcall *new_stmt, + bool update_speculative = true); /* Redirect callee of the edge to N. The function does not update underlying call expression. */ @@ -1755,10 +1757,10 @@ public: void redirect_callee_duplicating_thunks (cgraph_node *n); /* Make an indirect edge with an unknown callee an ordinary edge leading to - CALLEE. DELTA is an integer constant that is to be added to the this - pointer (first parameter) to compensate for skipping - a thunk adjustment. */ - cgraph_edge *make_direct (cgraph_node *callee); + CALLEE. Speculations can be resolved in the process and EDGE can be + removed and deallocated. Return the edge that now represents the + call. */ + static cgraph_edge *make_direct (cgraph_edge *edge, cgraph_node *callee); /* Turn edge into speculative call calling N2. Update the profile so the direct call is taken COUNT times @@ -1769,14 +1771,19 @@ public: void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference); - /* Speculative call edge turned out to be direct call to CALLEE_DECL. - Remove the speculative call sequence and return edge representing the call. - It is up to caller to redirect the call as appropriate. */ - cgraph_edge *resolve_speculation (tree callee_decl = NULL); + /* Speculative call edge turned out to be direct call to CALLEE_DECL. Remove + the speculative call sequence and return edge representing the call, the + original EDGE can be removed and deallocated. It is up to caller to + redirect the call as appropriate. Return the edge that now represents the + call. */ + static cgraph_edge *resolve_speculation (cgraph_edge *edge, + tree callee_decl = NULL); /* If necessary, change the function declaration in the call statement - associated with the edge so that it corresponds to the edge callee. */ - gimple *redirect_call_stmt_to_callee (void); + associated with edge E so that it corresponds to the edge callee. + Speculations can be resolved in the process and EDGE can be removed and + deallocated. */ + static gimple *redirect_call_stmt_to_callee (cgraph_edge *e); /* Create clone of edge in the node N represented by CALL_EXPR the callgraph. */ |