diff options
author | Richard Guenther <rguenth@gcc.gnu.org> | 2005-03-02 11:09:48 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2005-03-02 11:09:48 +0000 |
commit | 2563c2248f41b473e18c33125f40ef2196773fc0 (patch) | |
tree | bdb529abaec3ec0dbd00b6e655a0f76068edb9e0 /gcc/cgraphunit.c | |
parent | ceccf46b1067576cd6c9de7e4ab3af67aa35009e (diff) | |
download | gcc-2563c2248f41b473e18c33125f40ef2196773fc0.tar.gz |
cgraph.h (struct cgraph_edge): Add prev_caller and prev_callee fields.
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.
From-SVN: r95777
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 9 |
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 |