Skip to content

Commit

Permalink
remove unused postorder CFG cache
Browse files Browse the repository at this point in the history
  • Loading branch information
lqd committed Jun 14, 2023
1 parent 0b4b086 commit f134101
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions compiler/rustc_middle/src/mir/basic_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ struct Cache {
predecessors: OnceCell<Predecessors>,
switch_sources: OnceCell<SwitchSources>,
is_cyclic: OnceCell<bool>,
postorder: OnceCell<Vec<BasicBlock>>,
reverse_postorder: OnceCell<Vec<BasicBlock>>,
dominators: OnceCell<Dominators<BasicBlock>>,
}
Expand Down Expand Up @@ -63,14 +62,6 @@ impl<'tcx> BasicBlocks<'tcx> {
})
}

/// Returns basic blocks in a postorder.
#[inline]
pub fn postorder(&self) -> &[BasicBlock] {
self.cache.postorder.get_or_init(|| {
Postorder::new(&self.basic_blocks, START_BLOCK).map(|(bb, _)| bb).collect()
})
}

/// Returns basic blocks in a reverse postorder.
#[inline]
pub fn reverse_postorder(&self) -> &[BasicBlock] {
Expand Down

0 comments on commit f134101

Please sign in to comment.