pub trait UllbcPass: Sync {
// Provided methods
fn should_run(&self, _options: &TranslateOptions) -> bool { ... }
fn transform_body(&self, _ctx: &mut TransformCtx, _body: &mut ExprBody) { ... }
fn transform_function(&self, ctx: &mut TransformCtx, decl: &mut FunDecl) { ... }
fn transform_item(&self, ctx: &mut TransformCtx, item: ItemRefMut<'_>) { ... }
fn apply_preceding_passes(
&mut self,
_ctx: &mut TransformCtx,
_passes: &[CowBox<dyn UllbcPass>],
) { ... }
fn finalize(&self, _ctx: &mut TransformCtx) { ... }
fn name(&self) -> &str { ... }
}Expand description
A pass that modifies ullbc bodies and can be fused with previous passes so that we run all of them on a given body.
Provided Methods§
Sourcefn should_run(&self, _options: &TranslateOptions) -> bool
fn should_run(&self, _options: &TranslateOptions) -> bool
Whether the pass should run.
Sourcefn transform_body(&self, _ctx: &mut TransformCtx, _body: &mut ExprBody)
fn transform_body(&self, _ctx: &mut TransformCtx, _body: &mut ExprBody)
Transform a body.
Sourcefn transform_function(&self, ctx: &mut TransformCtx, decl: &mut FunDecl)
fn transform_function(&self, ctx: &mut TransformCtx, decl: &mut FunDecl)
Transform a function declaration. This forwards to transform_body by default.
Sourcefn transform_item(&self, ctx: &mut TransformCtx, item: ItemRefMut<'_>)
fn transform_item(&self, ctx: &mut TransformCtx, item: ItemRefMut<'_>)
Transform an item. This forwards to transform_function by default.
Sourcefn apply_preceding_passes(
&mut self,
_ctx: &mut TransformCtx,
_passes: &[CowBox<dyn UllbcPass>],
)
fn apply_preceding_passes( &mut self, _ctx: &mut TransformCtx, _passes: &[CowBox<dyn UllbcPass>], )
Some passes carry function bodies, which must also be transformed. This is called before the batch of passes starts, with all the passes that come before this one. Rougly only useful for passes that inline some functions into others.
Sourcefn finalize(&self, _ctx: &mut TransformCtx)
fn finalize(&self, _ctx: &mut TransformCtx)
Run after all the fused passes in the current block are done.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".