aboutsummaryrefslogtreecommitdiff
path: root/flow.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-25 16:47:35 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:04:53 -0700
commitca91540095fd708f02c4e125aebc0f645c94354c (patch)
treece008683477dc20c0783184a06ab88a39cf11019 /flow.c
parenthelper function cleanup: separate delete/replace list entries. (diff)
downloadsparse-ca91540095fd708f02c4e125aebc0f645c94354c.tar.gz
sparse-ca91540095fd708f02c4e125aebc0f645c94354c.tar.bz2
sparse-ca91540095fd708f02c4e125aebc0f645c94354c.zip
Use cleaned-up ptr list removal for removing basic blocks
from child and parent lists.
Diffstat (limited to 'flow.c')
-rw-r--r--flow.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/flow.c b/flow.c
index 9c6492a..8e95857 100644
--- a/flow.c
+++ b/flow.c
@@ -597,12 +597,21 @@ static void mark_bb_reachable(struct basic_block *bb, unsigned long generation)
void kill_bb(struct basic_block *bb)
{
struct instruction *insn;
+ struct basic_block *child, *parent;
FOR_EACH_PTR(bb->insns, insn) {
insn->bb = NULL;
} END_FOR_EACH_PTR(insn);
bb->insns = NULL;
+
+ FOR_EACH_PTR(bb->children, child) {
+ remove_bb_from_list(&child->parents, bb);
+ } END_FOR_EACH_PTR(child);
bb->children = NULL;
+
+ FOR_EACH_PTR(bb->parents, parent) {
+ remove_bb_from_list(&parent->children, bb);
+ } END_FOR_EACH_PTR(parent);
bb->parents = NULL;
}