Skip to main content

ModulePass

Trait ModulePass 

Source
pub trait ModulePass {
    // Required methods
    fn name(&self) -> &str;
    fn run(&mut self, module: &mut Module) -> bool;
}
Expand description

A transformation pass that mutates a MIR module.

Module-level passes can inspect or transform more than one function. Function-local passes should implement FunctionPass instead and use the blanket ModulePass implementation.

Required Methods§

Source

fn name(&self) -> &str

The name of this pass, for debugging and logging.

Source

fn run(&mut self, module: &mut Module) -> bool

Runs the transformation on the given module.

Returns true if the transform changed MIR.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§