Make ConstPropagator only visit basic blocks when visiting body
Avoid exercising unevaluated constants and go straight to visit the blocks.
This commit is contained in:
parent
0107cecc01
commit
f925a03ead
1 changed files with 6 additions and 0 deletions
|
|
@ -833,6 +833,12 @@ impl<'mir, 'tcx> MutVisitor<'tcx> for ConstPropagator<'mir, 'tcx> {
|
|||
self.tcx
|
||||
}
|
||||
|
||||
fn visit_body(&mut self, body: &mut Body<'tcx>) {
|
||||
for (bb, data) in body.basic_blocks_mut().iter_enumerated_mut() {
|
||||
self.visit_basic_block_data(bb, data);
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_constant(&mut self, constant: &mut Constant<'tcx>, location: Location) {
|
||||
trace!("visit_constant: {:?}", constant);
|
||||
self.super_constant(constant, location);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue