Make ConstPropagator only visit basic blocks when visiting body

Avoid exercising unevaluated constants and go straight to visit the
blocks.
上级 0107cecc
......@@ -833,6 +833,12 @@ fn tcx(&self) -> TyCtxt<'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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册