Skip to main content

IrPass

Trait IrPass 

Source
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§

Source

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

Human-readable name of the pass (for logging/diagnostics).

Source

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

Short description of what the pass does.

Source

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".

Implementors§