diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-11-26 22:41:55 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:05:02 -0700 |
commit | 06242e217c91fd3808091c1ed119a10131c4242e (patch) | |
tree | f622732d00966fccf9ce1ba87bfacf1677f028d7 /flow.c | |
parent | fcf778f11624e1d87f3ae241085c8ba32f5e83f9 (diff) | |
download | sparse-dev-06242e217c91fd3808091c1ed119a10131c4242e.tar.gz |
Be a lot more careful when re-writing branches.
Besides, the code is cleaner now - we can use our helper functions.
Diffstat (limited to 'flow.c')
-rw-r--r-- | flow.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -29,21 +29,13 @@ static void rewrite_branch(struct basic_block *bb, struct basic_block *old, struct basic_block *new) { - struct basic_block *tmp; - if (*ptr != old) return; *ptr = new; - FOR_EACH_PTR(new->parents, tmp) { - if (tmp == old) - *THIS_ADDRESS(tmp) = bb; - } END_FOR_EACH_PTR(tmp); - - FOR_EACH_PTR(bb->children, tmp) { - if (tmp == old) - *THIS_ADDRESS(tmp) = new; - } END_FOR_EACH_PTR(tmp); + replace_bb_in_list(&bb->children, old, new); + remove_bb_from_list(&old->parents, bb); + add_bb(&new->parents, bb); } /* |