aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenth@gcc.gnu.org>2005-03-02 11:09:48 +0000
committerRichard Guenther <rguenth@gcc.gnu.org>2005-03-02 11:09:48 +0000
commit9bea0284bf80cee4671fd7fc99bbef03f29d2768 (patch)
treebdb529abaec3ec0dbd00b6e655a0f76068edb9e0 /gcc/cgraphunit.c
parent0a9216df69992aea1604d686997f416d40f4fbd6 (diff)
2005-03-02 Richard Guenther <rguenth@gcc.gnu.org>
* cgraph.h (struct cgraph_edge): Add prev_caller and prev_callee fields. (cgraph_node_remove_callees): Export. * cgraph.c (cgraph_create_edge): Initialize prev_caller and prev_callee. (cgraph_edge_remove_callee): New function. (cgraph_edge_remove_caller): Likewise. (cgraph_remove_edge): Use. (cgraph_redirect_edge_callee): Likewise. (cgraph_node_remove_callees): New function. (cgraph_node_remove_callers): Likewise. (cgraph_remove_node): Use. * tree-optimize.c (tree_rest_of_compilation): Use cgraph_node_remove_callees instead of manual loop. * cgraphunit.c (cgraph_finalize_function): Likewise. (cgraph_expand_function): Likewise. (cgraph_remove_unreachable_nodes): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@95777 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 3df79a45f37..1effef6710a 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -356,8 +356,7 @@ cgraph_finalize_function (tree decl, bool nested)
cgraph_remove_node (n);
}
- while (node->callees)
- cgraph_remove_edge (node->callees);
+ cgraph_node_remove_callees (node);
/* We may need to re-queue the node for assembling in case
we already proceeded it and ignored as not needed. */
@@ -843,8 +842,7 @@ cgraph_expand_function (struct cgraph_node *node)
DECL_INITIAL (node->decl) = error_mark_node;
/* Eliminate all call edges. This is important so the call_expr no longer
points to the dead function body. */
- while (node->callees)
- cgraph_remove_edge (node->callees);
+ cgraph_node_remove_callees (node);
}
}
@@ -1006,8 +1004,7 @@ cgraph_remove_unreachable_nodes (void)
DECL_STRUCT_FUNCTION (node->decl) = NULL;
DECL_INITIAL (node->decl) = error_mark_node;
}
- while (node->callees)
- cgraph_remove_edge (node->callees);
+ cgraph_node_remove_callees (node);
node->analyzed = false;
}
else