From 5c0466b537af28f3cf7aff8d29c884a3c5725459 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Tue, 23 Sep 2008 15:08:15 +0200 Subject: cgraph.c (cgraph_free_edge): Use sizeof(*e). 2008-09-23 Martin Jambor * 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 --- gcc/cgraph.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'gcc/cgraph.c') 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); -- cgit v1.1