@@ -245,7 +245,7 @@ pub fn dominators<G: ControlFlowGraph>(graph: &G) -> Dominators<G::Node> {
245
245
246
246
let time = compute_access_time ( start_node, & immediate_dominators) ;
247
247
248
- Dominators { start_node , post_order_rank, immediate_dominators, time }
248
+ Dominators { post_order_rank, immediate_dominators, time }
249
249
}
250
250
251
251
/// Evaluate the link-eval virtual forest, providing the currently minimum semi
@@ -311,7 +311,6 @@ fn compress(
311
311
/// Tracks the list of dominators for each node.
312
312
#[ derive( Clone , Debug ) ]
313
313
pub struct Dominators < N : Idx > {
314
- start_node : N ,
315
314
post_order_rank : IndexVec < N , usize > ,
316
315
// Even though we track only the immediate dominator of each node, it's
317
316
// possible to get its full list of dominators by looking up the dominator
@@ -323,7 +322,7 @@ pub struct Dominators<N: Idx> {
323
322
impl < Node : Idx > Dominators < Node > {
324
323
/// Returns true if node is reachable from the start node.
325
324
pub fn is_reachable ( & self , node : Node ) -> bool {
326
- node == self . start_node || self . immediate_dominators [ node] . is_some ( )
325
+ self . time [ node] . start != 0
327
326
}
328
327
329
328
/// Returns the immediate dominator of node, if any.
0 commit comments