diff options
author | Martin Jambor <mjambor@suse.cz> | 2008-09-23 15:08:15 +0200 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2008-09-23 15:08:15 +0200 |
commit | 5c0466b537af28f3cf7aff8d29c884a3c5725459 (patch) | |
tree | 713f8a64e6ccf7e7bfd5473edd43495fd7cb70d1 /gcc/cgraph.c | |
parent | 4a2095e27167b9b55ff84ad4121dfbc4f7342c9f (diff) | |
download | gcc-5c0466b537af28f3cf7aff8d29c884a3c5725459.zip gcc-5c0466b537af28f3cf7aff8d29c884a3c5725459.tar.gz gcc-5c0466b537af28f3cf7aff8d29c884a3c5725459.tar.bz2 |
cgraph.c (cgraph_free_edge): Use sizeof(*e).
2008-09-23 Martin Jambor <mjambor@suse.cz>
* cgraph.c (cgraph_free_edge): Use sizeof(*e).
(cgraph_node_remove_callees): New temporary f. Hold the next item
in f when looping.
(cgraph_node_remove_callers): Likewise.
* ipa-prop.c (ipa_edge_removal_hook): Use ATTRIBUTE_UNUSED.
(ipa_node_removal_hook): Likewise.
* doc/gimple.texi (gimple_copy_call_skip_args): Changed to
gimple_call_copy_skip_args and moved to the gimple_call section.
* gimple.c (gimple_copy_call_skip_args): Renamed to
gimple_call_copy_skip_args. Changed al users.
From-SVN: r140590
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 90359a4..163ab9d 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -752,7 +752,7 @@ cgraph_free_edge (struct cgraph_edge *e) int uid = e->uid; /* Clear out the edge so we do not dangle pointers. */ - memset (e, 0, sizeof (e)); + memset (e, 0, sizeof (*e)); e->uid = uid; NEXT_FREE_EDGE (e) = free_edges; free_edges = e; @@ -846,13 +846,14 @@ cgraph_update_edges_for_call_stmt (gimple old_stmt, gimple new_stmt) void cgraph_node_remove_callees (struct cgraph_node *node) { - struct cgraph_edge *e; + struct cgraph_edge *e, *f; /* It is sufficient to remove the edges from the lists of callers of the callees. The callee list of the node can be zapped with one assignment. */ - for (e = node->callees; e; e = e->next_callee) + for (e = node->callees; e; e = f) { + f = e->next_callee; cgraph_call_edge_removal_hooks (e); cgraph_edge_remove_callee (e); cgraph_free_edge (e); @@ -870,13 +871,14 @@ cgraph_node_remove_callees (struct cgraph_node *node) static void cgraph_node_remove_callers (struct cgraph_node *node) { - struct cgraph_edge *e; + struct cgraph_edge *e, *f; /* It is sufficient to remove the edges from the lists of callees of the callers. The caller list of the node can be zapped with one assignment. */ - for (e = node->callers; e; e = e->next_caller) + for (e = node->callers; e; e = f) { + f = e->next_caller; cgraph_call_edge_removal_hooks (e); cgraph_edge_remove_caller (e); cgraph_free_edge (e); |