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:
parent
9ee22ff7e8
commit
7547084ff6
8 changed files with 101 additions and 72 deletions
|
@ -951,7 +951,7 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> {
|
|||
}
|
||||
|
||||
fn visit_body(&mut self, body: &mut Body<'tcx>) {
|
||||
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() {
|
||||
self.visit_basic_block_data(bb, data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue