pub trait MirPass<'tcx> {
    // Required method
    fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>);

    // Provided methods
    fn name(&self) -> &'static str { ... }
    fn is_enabled(&self, _sess: &Session) -> bool { ... }
    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§

source

fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>)

Provided Methods§

source

fn name(&self) -> &'static str

source

fn is_enabled(&self, _sess: &Session) -> bool

Returns true if this pass is enabled with the current combination of compiler flags.

source

fn is_mir_dump_enabled(&self) -> bool

Implementors§