1
Fork 0

Add option to mir::MutVisitor to not invalidate CFG.

This also applies that option to some uses of the visitor
This commit is contained in:
Jakob Degen 2022-08-02 20:06:16 -07:00
parent 9ee22ff7e8
commit 7547084ff6
8 changed files with 101 additions and 72 deletions

View file

@ -90,7 +90,7 @@ pub fn deref_finder<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
let patch = MirPatch::new(body);
let mut checker = DerefChecker { tcx, patcher: patch, local_decls: body.local_decls.clone() };
for (bb, data) in body.basic_blocks_mut().iter_enumerated_mut() {
for (bb, data) in body.basic_blocks.as_mut_preserves_cfg().iter_enumerated_mut() {
checker.visit_basic_block_data(bb, data);
}