summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-transform.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-inline-transform.c')
-rw-r--r--gcc/ipa-inline-transform.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 03442fc07d7..59241403a87 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -88,7 +88,7 @@ can_remove_node_now_p_1 (struct cgraph_node *node)
return (!node->address_taken
&& !node->has_aliases_p ()
&& !node->used_as_abstract_origin
- && cgraph_can_remove_if_no_direct_calls_p (node)
+ && node->can_remove_if_no_direct_calls_p ()
/* Inlining might enable more devirtualizing, so we want to remove
those only after all devirtualizable virtual calls are processed.
Lacking may edges in callgraph we just preserve them post
@@ -114,8 +114,8 @@ can_remove_node_now_p (struct cgraph_node *node, struct cgraph_edge *e)
items can be removed. */
if (!node->same_comdat_group)
return true;
- for (next = cgraph (node->same_comdat_group);
- next != node; next = cgraph (next->same_comdat_group))
+ for (next = dyn_cast<cgraph_node *> (node->same_comdat_group);
+ next != node; next = dyn_cast<cgraph_node *> (next->same_comdat_group))
if ((next->callers && next->callers != e)
|| !can_remove_node_now_p_1 (next))
return false;
@@ -165,7 +165,7 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
For now we keep the ohter functions in the group in program until
cgraph_remove_unreachable_functions gets rid of them. */
gcc_assert (!e->callee->global.inlined_to);
- symtab_dissolve_same_comdat_group_list (e->callee);
+ e->callee->dissolve_same_comdat_group_list ();
if (e->callee->definition && !DECL_EXTERNAL (e->callee->decl))
{
if (overall_size)
@@ -182,15 +182,17 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
if (freq_scale == -1)
freq_scale = e->frequency;
- n = cgraph_clone_node (e->callee, e->callee->decl,
- MIN (e->count, e->callee->count), freq_scale,
- update_original, vNULL, true, inlining_into,
- NULL);
+ n = e->callee->create_clone (e->callee->decl,
+ MIN (e->count, e->callee->count),
+ freq_scale,
+ update_original, vNULL, true,
+ inlining_into,
+ NULL);
cgraph_redirect_edge_callee (e, n);
}
}
else
- symtab_dissolve_same_comdat_group_list (e->callee);
+ e->callee->dissolve_same_comdat_group_list ();
e->callee->global.inlined_to = inlining_into;
@@ -222,14 +224,14 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
bool
inline_call (struct cgraph_edge *e, bool update_original,
- vec<cgraph_edge_p> *new_edges,
+ vec<cgraph_edge *> *new_edges,
int *overall_size, bool update_overall_summary,
bool *callee_removed)
{
int old_size = 0, new_size = 0;
struct cgraph_node *to = NULL;
struct cgraph_edge *curr = e;
- struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
+ struct cgraph_node *callee = e->callee->ultimate_alias_target ();
bool new_edges_found = false;
#ifdef ENABLE_CHECKING
@@ -261,8 +263,8 @@ inline_call (struct cgraph_edge *e, bool update_original,
if (!alias->callers
&& can_remove_node_now_p (alias, e))
{
- next_alias = cgraph_alias_target (alias);
- cgraph_remove_node (alias);
+ next_alias = alias->get_alias_target ();
+ alias->remove ();
if (callee_removed)
*callee_removed = true;
alias = next_alias;
@@ -286,11 +288,11 @@ inline_call (struct cgraph_edge *e, bool update_original,
if (callee->calls_comdat_local)
to->calls_comdat_local = true;
- else if (to->calls_comdat_local && symtab_comdat_local_p (callee))
+ else if (to->calls_comdat_local && callee->comdat_local_p ())
{
struct cgraph_edge *se = to->callees;
for (; se; se = se->next_callee)
- if (se->inline_failed && symtab_comdat_local_p (se->callee))
+ if (se->inline_failed && se->callee->comdat_local_p ())
break;
if (se == NULL)
to->calls_comdat_local = false;
@@ -336,13 +338,13 @@ save_inline_function_body (struct cgraph_node *node)
fprintf (dump_file, "\nSaving body of %s for later reuse\n",
node->name ());
- gcc_assert (node == cgraph_get_node (node->decl));
+ gcc_assert (node == cgraph_node::get (node->decl));
/* first_clone will be turned into real function. */
first_clone = node->clones;
first_clone->decl = copy_node (node->decl);
first_clone->decl->decl_with_vis.symtab_node = first_clone;
- gcc_assert (first_clone == cgraph_get_node (first_clone->decl));
+ gcc_assert (first_clone == cgraph_node::get (first_clone->decl));
/* Now reshape the clone tree, so all other clones descends from
first_clone. */
@@ -404,12 +406,12 @@ save_inline_function_body (struct cgraph_node *node)
Remove it now. */
if (!first_clone->callers)
{
- cgraph_remove_node_and_inline_clones (first_clone, NULL);
+ first_clone->remove_symbol_and_inline_clones ();
first_clone = NULL;
}
#ifdef ENABLE_CHECKING
else
- verify_cgraph_node (first_clone);
+ first_clone->verify ();
#endif
return first_clone;
}