Revert "Add dom_walker::walk_until"
2015-11-06 Tom de Vries <tom@codesourcery.com>
revert:
2015-10-12 Tom de Vries <tom@codesourcery.com>
* domwalk.c (dom_walker::walk): Rename to ...
(dom_walker::walk_until): ... this. Add and handle until and
until_inclusive parameters.
(dom_walker::walk): Reimplement using dom_walker::walk_until.
* domwalk.h (dom_walker::walk_until): Declare.
---
gcc/domwalk.c | 32 +++++---------------------------
gcc/domwalk.h | 2 --
2 files changed, 5 insertions(+), 29 deletions(-)
@@ -143,18 +143,11 @@ cmp_bb_postorder (const void *a, const void *b)
}
/* Recursively walk the dominator tree.
- BB is the basic block we are currently visiting. UNTIL is a basic_block that
- is the root of a subtree that we won't visit. If UNTIL_INCLUSIVE, we visit
- UNTIL, but not it's children. Otherwise don't visit UNTIL and its
- children. */
+ BB is the basic block we are currently visiting. */
void
-dom_walker::walk_until (basic_block bb, basic_block until, bool until_inclusive)
+dom_walker::walk (basic_block bb)
{
- bool skip_self = (bb == until && !until_inclusive);
- if (skip_self)
- return;
-
basic_block dest;
basic_block *worklist = XNEWVEC (basic_block,
n_basic_blocks_for_fn (cfun) * 2);
@@ -188,15 +181,9 @@ dom_walker::walk_until (basic_block bb, basic_block until, bool until_inclusive)
worklist[sp++] = NULL;
int saved_sp = sp;
- bool skip_children = bb == until && until_inclusive;
- if (!skip_children)
- for (dest = first_dom_son (m_dom_direction, bb);
- dest; dest = next_dom_son (m_dom_direction, dest))
- {
- bool skip_child = (dest == until && !until_inclusive);
- if (!skip_child)
- worklist[sp++] = dest;
- }
+ for (dest = first_dom_son (m_dom_direction, bb);
+ dest; dest = next_dom_son (m_dom_direction, dest))
+ worklist[sp++] = dest;
if (m_dom_direction == CDI_DOMINATORS)
switch (sp - saved_sp)
{
@@ -230,12 +217,3 @@ dom_walker::walk_until (basic_block bb, basic_block until, bool until_inclusive)
}
free (worklist);
}
-
-/* Recursively walk the dominator tree.
- BB is the basic block we are currently visiting. */
-
-void
-dom_walker::walk (basic_block bb)
-{
- walk_until (bb, NULL, true);
-}
@@ -34,8 +34,6 @@ public:
/* Walk the dominator tree. */
void walk (basic_block);
- /* Walk a part of the dominator tree. */
- void walk_until (basic_block, basic_block, bool);
/* Function to call before the recursive walk of the dominator children. */
virtual void before_dom_children (basic_block) {}
--
1.9.1