Trait rustc_middle::mir::MirPass
source · [−]pub trait MirPass<'tcx> {
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>);
fn name(&self) -> Cow<'_, str> { ... }
fn is_enabled(&self, _sess: &Session) -> bool { ... }
fn phase_change(&self) -> Option<MirPhase> { ... }
fn is_mir_dump_enabled(&self) -> bool { ... }
}
Expand description
A streamlined trait that you can implement to create a pass; the
pass will be named after the type, and it will consist of a main
loop that goes over each available MIR and applies run_pass
.
Required Methods
Provided Methods
sourcefn is_enabled(&self, _sess: &Session) -> bool
fn is_enabled(&self, _sess: &Session) -> bool
Returns true
if this pass is enabled with the current combination of compiler flags.
sourcefn phase_change(&self) -> Option<MirPhase>
fn phase_change(&self) -> Option<MirPhase>
If this pass causes the MIR to enter a new phase, return that phase.
source