Rollup merge of #116612 - tmiasko:rm-dom-iter, r=cjgillot
Remove unused dominator iterator
This commit is contained in:
commit
88a929ba32
@ -349,7 +349,7 @@ struct Inner<N: Idx> {
|
|||||||
post_order_rank: IndexVec<N, usize>,
|
post_order_rank: IndexVec<N, usize>,
|
||||||
// Even though we track only the immediate dominator of each node, it's
|
// Even though we track only the immediate dominator of each node, it's
|
||||||
// possible to get its full list of dominators by looking up the dominator
|
// possible to get its full list of dominators by looking up the dominator
|
||||||
// of each dominator. (See the `impl Iterator for Iter` definition).
|
// of each dominator.
|
||||||
immediate_dominators: IndexVec<N, Option<N>>,
|
immediate_dominators: IndexVec<N, Option<N>>,
|
||||||
time: IndexVec<N, Time>,
|
time: IndexVec<N, Time>,
|
||||||
}
|
}
|
||||||
@ -377,13 +377,6 @@ pub fn immediate_dominator(&self, node: Node) -> Option<Node> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Provides an iterator over each dominator up the CFG, for the given Node.
|
|
||||||
/// See the `impl Iterator for Iter` definition to understand how this works.
|
|
||||||
pub fn dominators(&self, node: Node) -> Iter<'_, Node> {
|
|
||||||
assert!(self.is_reachable(node), "node {node:?} is not reachable");
|
|
||||||
Iter { dom_tree: self, node: Some(node) }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Provide deterministic ordering of nodes such that, if any two nodes have a dominator
|
/// Provide deterministic ordering of nodes such that, if any two nodes have a dominator
|
||||||
/// relationship, the dominator will always precede the dominated. (The relative ordering
|
/// relationship, the dominator will always precede the dominated. (The relative ordering
|
||||||
/// of two unrelated nodes will also be consistent, but otherwise the order has no
|
/// of two unrelated nodes will also be consistent, but otherwise the order has no
|
||||||
@ -413,24 +406,6 @@ pub fn dominates(&self, a: Node, b: Node) -> bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Iter<'dom, Node: Idx> {
|
|
||||||
dom_tree: &'dom Dominators<Node>,
|
|
||||||
node: Option<Node>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'dom, Node: Idx> Iterator for Iter<'dom, Node> {
|
|
||||||
type Item = Node;
|
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
|
||||||
if let Some(node) = self.node {
|
|
||||||
self.node = self.dom_tree.immediate_dominator(node);
|
|
||||||
Some(node)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Describes the number of vertices discovered at the time when processing of a particular vertex
|
/// Describes the number of vertices discovered at the time when processing of a particular vertex
|
||||||
/// started and when it finished. Both values are zero for unreachable vertices.
|
/// started and when it finished. Both values are zero for unreachable vertices.
|
||||||
#[derive(Copy, Clone, Default, Debug)]
|
#[derive(Copy, Clone, Default, Debug)]
|
||||||
|
Loading…
Reference in New Issue
Block a user