From 7149bbcdc5739e4ed1fa3697c1b4d441f1d4441c Mon Sep 17 00:00:00 2001 From: SparrowLii Date: Thu, 28 Apr 2022 11:31:08 +0800 Subject: Eliminate duplication of RPO calculation for mir add `postorder_cache` to mir Body add `ReversePostorderCache` struct correct struct name and comments --- compiler/rustc_const_eval/src/transform/promote_consts.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_const_eval/src/transform') diff --git a/compiler/rustc_const_eval/src/transform/promote_consts.rs b/compiler/rustc_const_eval/src/transform/promote_consts.rs index faea2111d92..1052d588fad 100644 --- a/compiler/rustc_const_eval/src/transform/promote_consts.rs +++ b/compiler/rustc_const_eval/src/transform/promote_consts.rs @@ -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, Vec) { let mut collector = Collector { temps: IndexVec::from_elem(TempState::Undefined, &ccx.body.local_decls), -- cgit 1.4.1-3-g733a5