Don't resolve basic block data in Postorder
The only usage immediately throws out the data, so.
This commit is contained in:
parent
0d8a45813c
commit
a7f3c4e608
@ -66,8 +66,7 @@ pub fn predecessors(&self) -> &Predecessors {
|
||||
#[inline]
|
||||
pub fn reverse_postorder(&self) -> &[BasicBlock] {
|
||||
self.cache.reverse_postorder.get_or_init(|| {
|
||||
let mut rpo: Vec<_> =
|
||||
Postorder::new(&self.basic_blocks, START_BLOCK).map(|(bb, _)| bb).collect();
|
||||
let mut rpo: Vec<_> = Postorder::new(&self.basic_blocks, START_BLOCK).collect();
|
||||
rpo.reverse();
|
||||
rpo
|
||||
})
|
||||
|
@ -188,14 +188,14 @@ fn traverse_successor(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> {
|
||||
type Item = (BasicBlock, &'a BasicBlockData<'tcx>);
|
||||
impl<'tcx> Iterator for Postorder<'_, 'tcx> {
|
||||
type Item = BasicBlock;
|
||||
|
||||
fn next(&mut self) -> Option<(BasicBlock, &'a BasicBlockData<'tcx>)> {
|
||||
fn next(&mut self) -> Option<BasicBlock> {
|
||||
let (bb, _) = self.visit_stack.pop()?;
|
||||
self.traverse_successor();
|
||||
|
||||
Some((bb, &self.basic_blocks[bb]))
|
||||
|
||||
Some(bb)
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
|
Loading…
Reference in New Issue
Block a user