1
Fork 0

Move SimplifyLocals before ConstProp.

This commit is contained in:
Camille GILLOT 2022-12-04 19:20:55 +00:00
parent 22e9e52c84
commit 028b4745f4
43 changed files with 348 additions and 436 deletions

View file

@ -379,9 +379,21 @@ fn save_unreachable_coverage(
));
}
pub struct SimplifyLocals;
pub struct SimplifyLocals {
label: String,
}
impl SimplifyLocals {
pub fn new(label: &str) -> SimplifyLocals {
SimplifyLocals { label: format!("SimplifyLocals-{}", label) }
}
}
impl<'tcx> MirPass<'tcx> for SimplifyLocals {
fn name(&self) -> &str {
&self.label
}
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
sess.mir_opt_level() > 0
}