Eliminate duplication of RPO calculation for mir
add `postorder_cache` to mir Body add `ReversePostorderCache` struct correct struct name and comments
This commit is contained in:
parent
c95346b8ac
commit
7149bbcdc5
4 changed files with 96 additions and 7 deletions
|
@ -13,7 +13,7 @@
|
|||
//! move analysis runs after promotion on broken MIR.
|
||||
|
||||
use rustc_hir as hir;
|
||||
use rustc_middle::mir::traversal::ReversePostorder;
|
||||
use rustc_middle::mir::traversal::ReversePostorderIter;
|
||||
use rustc_middle::mir::visit::{MutVisitor, MutatingUseContext, PlaceContext, Visitor};
|
||||
use rustc_middle::mir::*;
|
||||
use rustc_middle::ty::cast::CastTy;
|
||||
|
@ -170,7 +170,7 @@ impl<'tcx> Visitor<'tcx> for Collector<'_, 'tcx> {
|
|||
|
||||
pub fn collect_temps_and_candidates<'tcx>(
|
||||
ccx: &ConstCx<'_, 'tcx>,
|
||||
rpo: &mut ReversePostorder<'_, 'tcx>,
|
||||
rpo: &mut ReversePostorderIter<'_, 'tcx>,
|
||||
) -> (IndexVec<Local, TempState>, Vec<Candidate>) {
|
||||
let mut collector = Collector {
|
||||
temps: IndexVec::from_elem(TempState::Undefined, &ccx.body.local_decls),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue