@@ -349,7 +349,7 @@ struct Inner<N: Idx> {
349
349
post_order_rank : IndexVec < N , usize > ,
350
350
// Even though we track only the immediate dominator of each node, it's
351
351
// 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.
353
353
immediate_dominators : IndexVec < N , Option < N > > ,
354
354
time : IndexVec < N , Time > ,
355
355
}
@@ -377,13 +377,6 @@ impl<Node: Idx> Dominators<Node> {
377
377
}
378
378
}
379
379
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
-
387
380
/// Provide deterministic ordering of nodes such that, if any two nodes have a dominator
388
381
/// relationship, the dominator will always precede the dominated. (The relative ordering
389
382
/// of two unrelated nodes will also be consistent, but otherwise the order has no
@@ -413,24 +406,6 @@ impl<Node: Idx> Dominators<Node> {
413
406
}
414
407
}
415
408
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
-
434
409
/// Describes the number of vertices discovered at the time when processing of a particular vertex
435
410
/// started and when it finished. Both values are zero for unreachable vertices.
436
411
#[ derive( Copy , Clone , Default , Debug ) ]
0 commit comments