summaryrefslogtreecommitdiff
path: root/gcc/cgraphbuild.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraphbuild.c')
-rw-r--r--gcc/cgraphbuild.c59
1 files changed, 20 insertions, 39 deletions
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 6bdc8ca0eda..bfc4495ca19 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -82,17 +82,13 @@ record_reference (tree *tp, int *walk_subtrees, void *data)
struct cgraph_node *node = cgraph_get_create_node (decl);
if (!ctx->only_vars)
cgraph_mark_address_taken_node (node);
- ipa_record_reference (ctx->varpool_node,
- node,
- IPA_REF_ADDR, NULL);
+ ctx->varpool_node->add_reference (node, IPA_REF_ADDR);
}
if (TREE_CODE (decl) == VAR_DECL)
{
varpool_node *vnode = varpool_node_for_decl (decl);
- ipa_record_reference (ctx->varpool_node,
- vnode,
- IPA_REF_ADDR, NULL);
+ ctx->varpool_node->add_reference (vnode, IPA_REF_ADDR);
}
*walk_subtrees = 0;
break;
@@ -129,9 +125,7 @@ record_type_list (struct cgraph_node *node, tree list)
if (TREE_CODE (type) == VAR_DECL)
{
varpool_node *vnode = varpool_node_for_decl (type);
- ipa_record_reference (node,
- vnode,
- IPA_REF_ADDR, NULL);
+ node->add_reference (vnode, IPA_REF_ADDR);
}
}
}
@@ -150,7 +144,7 @@ record_eh_tables (struct cgraph_node *node, struct function *fun)
tree per_decl = DECL_FUNCTION_PERSONALITY (node->decl);
struct cgraph_node *per_node = cgraph_get_create_node (per_decl);
- ipa_record_reference (node, per_node, IPA_REF_ADDR, NULL);
+ node->add_reference (per_node, IPA_REF_ADDR);
cgraph_mark_address_taken_node (per_node);
}
@@ -231,18 +225,14 @@ mark_address (gimple stmt, tree addr, tree, void *data)
{
struct cgraph_node *node = cgraph_get_create_node (addr);
cgraph_mark_address_taken_node (node);
- ipa_record_reference ((symtab_node *)data,
- node,
- IPA_REF_ADDR, stmt);
+ ((symtab_node *)data)->add_reference (node, IPA_REF_ADDR, stmt);
}
else if (addr && TREE_CODE (addr) == VAR_DECL
&& (TREE_STATIC (addr) || DECL_EXTERNAL (addr)))
{
varpool_node *vnode = varpool_node_for_decl (addr);
- ipa_record_reference ((symtab_node *)data,
- vnode,
- IPA_REF_ADDR, stmt);
+ ((symtab_node *)data)->add_reference (vnode, IPA_REF_ADDR, stmt);
}
return false;
@@ -260,18 +250,14 @@ mark_load (gimple stmt, tree t, tree, void *data)
directly manipulated in the code. Pretend that it's an address. */
struct cgraph_node *node = cgraph_get_create_node (t);
cgraph_mark_address_taken_node (node);
- ipa_record_reference ((symtab_node *)data,
- node,
- IPA_REF_ADDR, stmt);
+ ((symtab_node *)data)->add_reference (node, IPA_REF_ADDR, stmt);
}
else if (t && TREE_CODE (t) == VAR_DECL
&& (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
varpool_node *vnode = varpool_node_for_decl (t);
- ipa_record_reference ((symtab_node *)data,
- vnode,
- IPA_REF_LOAD, stmt);
+ ((symtab_node *)data)->add_reference (vnode, IPA_REF_LOAD, stmt);
}
return false;
}
@@ -287,9 +273,7 @@ mark_store (gimple stmt, tree t, tree, void *data)
{
varpool_node *vnode = varpool_node_for_decl (t);
- ipa_record_reference ((symtab_node *)data,
- vnode,
- IPA_REF_STORE, stmt);
+ ((symtab_node *)data)->add_reference (vnode, IPA_REF_STORE, stmt);
}
return false;
}
@@ -375,22 +359,19 @@ pass_build_cgraph_edges::execute (function *fun)
&& gimple_omp_parallel_child_fn (stmt))
{
tree fn = gimple_omp_parallel_child_fn (stmt);
- ipa_record_reference (node,
- cgraph_get_create_node (fn),
- IPA_REF_ADDR, stmt);
+ node->add_reference (cgraph_get_create_node (fn),
+ IPA_REF_ADDR, stmt);
}
if (gimple_code (stmt) == GIMPLE_OMP_TASK)
{
tree fn = gimple_omp_task_child_fn (stmt);
if (fn)
- ipa_record_reference (node,
- cgraph_get_create_node (fn),
- IPA_REF_ADDR, stmt);
+ node->add_reference (cgraph_get_create_node (fn),
+ IPA_REF_ADDR, stmt);
fn = gimple_omp_task_copy_fn (stmt);
if (fn)
- ipa_record_reference (node,
- cgraph_get_create_node (fn),
- IPA_REF_ADDR, stmt);
+ node->add_reference (cgraph_get_create_node (fn),
+ IPA_REF_ADDR, stmt);
}
}
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
@@ -446,7 +427,7 @@ rebuild_cgraph_edges (void)
gimple_stmt_iterator gsi;
cgraph_node_remove_callees (node);
- ipa_remove_all_references (&node->ref_list);
+ node->remove_all_references ();
node->count = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count;
@@ -492,13 +473,13 @@ cgraph_rebuild_references (void)
basic_block bb;
struct cgraph_node *node = cgraph_get_node (current_function_decl);
gimple_stmt_iterator gsi;
- struct ipa_ref *ref;
+ struct ipa_ref *ref = NULL;
int i;
/* Keep speculative references for further cgraph edge expansion. */
- for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list, i, ref);)
+ for (i = 0; node->iterate_reference (i, ref);)
if (!ref->speculative)
- ipa_remove_reference (ref);
+ ref->remove_reference ();
else
i++;
@@ -588,7 +569,7 @@ pass_remove_cgraph_callee_edges::execute (function *)
{
struct cgraph_node *node = cgraph_get_node (current_function_decl);
cgraph_node_remove_callees (node);
- ipa_remove_all_references (&node->ref_list);
+ node->remove_all_references ();
return 0;
}