Skip to main content

UllbcPass

Trait UllbcPass 

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

Source

fn should_run(&self, _options: &TranslateOptions) -> bool

Whether the pass should run.

Source

fn transform_body(&self, _ctx: &mut TransformCtx, _body: &mut ExprBody)

Transform a body.

Source

fn transform_function(&self, ctx: &mut TransformCtx, decl: &mut FunDecl)

Transform a function declaration. This forwards to transform_body by default.

Source

fn transform_item(&self, ctx: &mut TransformCtx, item: ItemRefMut<'_>)

Transform an item. This forwards to transform_function by default.

Source

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.

Source

fn finalize(&self, _ctx: &mut TransformCtx)

Run after all the fused passes in the current block are done.

Source

fn name(&self) -> &str

The name of the pass, used for debug logging. The default implementation uses the type name.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl UllbcPass for charon_lib::transform::finish_translation::insert_assign_return_unit::Transform

Source§

impl UllbcPass for charon_lib::transform::finish_translation::insert_ptr_metadata::Transform

Source§

impl UllbcPass for charon_lib::transform::finish_translation::insert_storage_lives::Transform

Source§

impl UllbcPass for charon_lib::transform::normalize::desugar_drops::Transform

Source§

impl UllbcPass for charon_lib::transform::normalize::filter_unreachable_blocks::Transform

Source§

impl UllbcPass for charon_lib::transform::normalize::skip_trait_refs_when_known::Transform

Source§

impl UllbcPass for charon_lib::transform::normalize::transform_dyn_trait_calls::Transform

Source§

impl UllbcPass for charon_lib::transform::resugar::move_asserts_to_statements::Transform

Source§

impl UllbcPass for charon_lib::transform::resugar::reconstruct_asserts::Transform

Source§

impl UllbcPass for charon_lib::transform::resugar::reconstruct_box_derefs::Transform

Source§

impl UllbcPass for charon_lib::transform::resugar::reconstruct_fallible_operations::Transform

Source§

impl UllbcPass for charon_lib::transform::resugar::reconstruct_intrinsics::Transform

Source§

impl UllbcPass for charon_lib::transform::resugar::reconstruct_vec_boxes::Transform

Source§

impl UllbcPass for charon_lib::transform::simplify_output::anon_const_to_call::Transform

Source§

impl UllbcPass for charon_lib::transform::simplify_output::filter_trivial_drops::Transform

Source§

impl UllbcPass for charon_lib::transform::simplify_output::index_intermediate_assigns::Transform

Source§

impl UllbcPass for charon_lib::transform::simplify_output::inline_selected_functions::Transform

Source§

impl UllbcPass for charon_lib::transform::simplify_output::remove_unit_locals::Transform

Source§

impl UllbcPass for charon_lib::transform::simplify_output::remove_unused_locals::Transform

Source§

impl UllbcPass for charon_lib::transform::simplify_output::simplify_constants::Transform

Source§

impl UllbcPass for charon_lib::transform::simplify_output::update_block_indices::Transform

Source§

impl UllbcPass for charon_lib::transform::control_flow::duplicate_return::Transform

Source§

impl UllbcPass for charon_lib::transform::control_flow::merge_goto_chains::Transform