Skip to main content

OptPass

Trait OptPass 

Source
pub trait OptPass: Debug {
    // Required methods
    fn name(&self) -> &str;
    fn run_pass(&mut self, decls: &mut [LcnfFunDecl]) -> usize;

    // Provided methods
    fn is_enabled(&self) -> bool { ... }
    fn dependencies(&self) -> Vec<&str> { ... }
}
Expand description

Trait for optimization passes that operate on LCNF function declarations.

Required Methods§

Source

fn name(&self) -> &str

Human-readable name of this pass.

Source

fn run_pass(&mut self, decls: &mut [LcnfFunDecl]) -> usize

Run the pass on a set of declarations, returning the number of changes made.

Provided Methods§

Source

fn is_enabled(&self) -> bool

Whether this pass is enabled.

Source

fn dependencies(&self) -> Vec<&str>

Dependencies: names of passes that must run before this one.

Implementors§