about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/graph
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2023-10-05 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2023-10-05 23:45:58 +0200
commitba694e301cfbb7709db159b7b876af9fd18a43c3 (patch)
tree993589eba534ed832f18ad8e3d885d8927679dbd /compiler/rustc_data_structures/src/graph
parenta8ec7ddf0efac856abc71ab0394933afc58a9f26 (diff)
downloadrust-ba694e301cfbb7709db159b7b876af9fd18a43c3.tar.gz
rust-ba694e301cfbb7709db159b7b876af9fd18a43c3.zip
Remove redundant Dominators::start_node field
Diffstat (limited to 'compiler/rustc_data_structures/src/graph')
-rw-r--r--compiler/rustc_data_structures/src/graph/dominators/mod.rs5
1 files changed, 2 insertions, 3 deletions
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<G: ControlFlowGraph>(graph: &G) -> Dominators<G::Node> {
 
     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<N: Idx> {
-    start_node: N,
     post_order_rank: IndexVec<N, usize>,
     // 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<N: Idx> {
 impl<Node: Idx> Dominators<Node> {
     /// 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.