pub trait IRTransform: Send + Sync {
// Required methods
fn transform(
&mut self,
ir: &mut IntermediateRepresentation,
) -> Result<(), IRError>;
fn should_run(&self, level: OptimizationLevel) -> bool;
fn name(&self) -> &str;
}
Expand description
IR transformation trait
Required Methods§
Sourcefn transform(
&mut self,
ir: &mut IntermediateRepresentation,
) -> Result<(), IRError>
fn transform( &mut self, ir: &mut IntermediateRepresentation, ) -> Result<(), IRError>
Apply transformation to IR
Sourcefn should_run(&self, level: OptimizationLevel) -> bool
fn should_run(&self, level: OptimizationLevel) -> bool
Check if pass should run at given optimization level