pub trait IrPass {
// Required methods
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn run(&mut self, module: &mut IrModule) -> PassResult;
}Expand description
A transformation or validation pass over the IR.
Passes should be idempotent where possible: running the same pass
twice on the same module should produce the same result, and the
second run should return changed: false.
Required Methods§
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Short description of what the pass does.
Sourcefn run(&mut self, module: &mut IrModule) -> PassResult
fn run(&mut self, module: &mut IrModule) -> PassResult
Run the pass on the module, potentially mutating it in place.
Returns a PassResult indicating whether the IR was modified
and any diagnostics produced.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".