Update passes with new interface
This commit is contained in:
@@ -45,11 +45,11 @@ use smallvec::SmallVec;
|
||||
pub struct SeparateConstSwitch;
|
||||
|
||||
impl<'tcx> MirPass<'tcx> for SeparateConstSwitch {
|
||||
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||
if tcx.sess.mir_opt_level() < 4 {
|
||||
return;
|
||||
}
|
||||
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
|
||||
sess.mir_opt_level() >= 4
|
||||
}
|
||||
|
||||
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||
// If execution did something, applying a simplification layer
|
||||
// helps later passes optimize the copy away.
|
||||
if separate_const_switch(body) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user