From ba694e301cfbb7709db159b7b876af9fd18a43c3 Mon Sep 17 00:00:00 2001 From: Tomasz Miąsko Date: Thu, 5 Oct 2023 00:00:00 +0000 Subject: Remove redundant Dominators::start_node field --- compiler/rustc_data_structures/src/graph/dominators/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_data_structures/src') diff --git a/compiler/rustc_data_structures/src/graph/dominators/mod.rs b/compiler/rustc_data_structures/src/graph/dominators/mod.rs index 4075481e561..b17e5467ea9 100644 --- a/compiler/rustc_data_structures/src/graph/dominators/mod.rs +++ b/compiler/rustc_data_structures/src/graph/dominators/mod.rs @@ -245,7 +245,7 @@ pub fn dominators(graph: &G) -> Dominators { let time = compute_access_time(start_node, &immediate_dominators); - Dominators { start_node, post_order_rank, immediate_dominators, time } + Dominators { post_order_rank, immediate_dominators, time } } /// Evaluate the link-eval virtual forest, providing the currently minimum semi @@ -311,7 +311,6 @@ fn compress( /// Tracks the list of dominators for each node. #[derive(Clone, Debug)] pub struct Dominators { - start_node: N, post_order_rank: IndexVec, // 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 @@ -323,7 +322,7 @@ pub struct Dominators { impl Dominators { /// Returns true if node is reachable from the start node. pub fn is_reachable(&self, node: Node) -> bool { - node == self.start_node || self.immediate_dominators[node].is_some() + self.time[node].start != 0 } /// Returns the immediate dominator of node, if any. -- cgit 1.4.1-3-g733a5