diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-20 15:27:18 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-20 15:27:18 +0000 |
commit | 113a8828735449dffb3f9e2dbac00ae4235b68d2 (patch) | |
tree | 9295919722e5f5a302f8ec2e11579c6b99f514ae | |
parent | 67409385de6e36bd5b6bd23d81adbf06b3cd12ad (diff) | |
download | gcc-113a8828735449dffb3f9e2dbac00ae4235b68d2.tar.gz |
* cgraph.h (cgraph_node): Add prev_clone pointer.
* cgraph.c (cgraph_remove_node): Remove from doubly linked chain.
(cgraph_clone_node): Produce doubly linked chain.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96761 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cgraph.c | 14 | ||||
-rw-r--r-- | gcc/cgraph.h | 1 |
3 files changed, 16 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 171eeefc5f3..379ac7fdee9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-03-20 Jan Hubicka <jh@suse.cz> + + * cgraph.h (cgraph_node): Add prev_clone pointer. + * cgraph.c (cgraph_remove_node): Remove from doubly linked chain. + (cgraph_clone_node): Produce doubly linked chain. + 2005-03-20 Joseph S. Myers <joseph@codesourcery.com> * c-common.c (handle_aligned_attribute, check_function_sentinel, diff --git a/gcc/cgraph.c b/gcc/cgraph.c index c7475c18eb3..3aabc4071fb 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -422,7 +422,10 @@ cgraph_remove_node (struct cgraph_node *node) if (*slot == node) { if (node->next_clone) + { *slot = node->next_clone; + node->next_clone->prev_clone = NULL; + } else { htab_clear_slot (cgraph_hash, slot); @@ -431,11 +434,9 @@ cgraph_remove_node (struct cgraph_node *node) } else { - struct cgraph_node *n; - - for (n = *slot; n->next_clone != node; n = n->next_clone) - continue; - n->next_clone = node->next_clone; + node->prev_clone->next_clone = node->next_clone; + if (node->next_clone) + node->next_clone->prev_clone = node->prev_clone; } /* While all the clones are removed after being proceeded, the function @@ -779,7 +780,10 @@ cgraph_clone_node (struct cgraph_node *n) cgraph_clone_edge (e, new, e->call_expr); new->next_clone = n->next_clone; + new->prev_clone = n; n->next_clone = new; + if (new->next_clone) + new->next_clone->prev_clone = new; return new; } diff --git a/gcc/cgraph.h b/gcc/cgraph.h index b596a36a223..2a1c1b3b949 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -98,6 +98,7 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) struct cgraph_node *next_needed; /* Pointer to the next clone. */ struct cgraph_node *next_clone; + struct cgraph_node *prev_clone; PTR GTY ((skip)) aux; struct cgraph_local_info local; |