Skip to content

Commit b61a6d5

Browse files
committed
Remove unused dominator iterator
1 parent c30b28b commit b61a6d5

File tree

1 file changed

+1
-26
lines changed
  • compiler/rustc_data_structures/src/graph/dominators

1 file changed

+1
-26
lines changed

compiler/rustc_data_structures/src/graph/dominators/mod.rs

+1-26
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ struct Inner<N: Idx> {
349349
post_order_rank: IndexVec<N, usize>,
350350
// Even though we track only the immediate dominator of each node, it's
351351
// possible to get its full list of dominators by looking up the dominator
352-
// of each dominator. (See the `impl Iterator for Iter` definition).
352+
// of each dominator.
353353
immediate_dominators: IndexVec<N, Option<N>>,
354354
time: IndexVec<N, Time>,
355355
}
@@ -377,13 +377,6 @@ impl<Node: Idx> Dominators<Node> {
377377
}
378378
}
379379

380-
/// Provides an iterator over each dominator up the CFG, for the given Node.
381-
/// See the `impl Iterator for Iter` definition to understand how this works.
382-
pub fn dominators(&self, node: Node) -> Iter<'_, Node> {
383-
assert!(self.is_reachable(node), "node {node:?} is not reachable");
384-
Iter { dom_tree: self, node: Some(node) }
385-
}
386-
387380
/// Provide deterministic ordering of nodes such that, if any two nodes have a dominator
388381
/// relationship, the dominator will always precede the dominated. (The relative ordering
389382
/// of two unrelated nodes will also be consistent, but otherwise the order has no
@@ -413,24 +406,6 @@ impl<Node: Idx> Dominators<Node> {
413406
}
414407
}
415408

416-
pub struct Iter<'dom, Node: Idx> {
417-
dom_tree: &'dom Dominators<Node>,
418-
node: Option<Node>,
419-
}
420-
421-
impl<'dom, Node: Idx> Iterator for Iter<'dom, Node> {
422-
type Item = Node;
423-
424-
fn next(&mut self) -> Option<Self::Item> {
425-
if let Some(node) = self.node {
426-
self.node = self.dom_tree.immediate_dominator(node);
427-
Some(node)
428-
} else {
429-
None
430-
}
431-
}
432-
}
433-
434409
/// Describes the number of vertices discovered at the time when processing of a particular vertex
435410
/// started and when it finished. Both values are zero for unreachable vertices.
436411
#[derive(Copy, Clone, Default, Debug)]

0 commit comments

Comments
 (0)