Trait BodyTransformCtx

Source
pub trait BodyTransformCtx {
    // Required methods
    fn get_locals_mut(&mut self) -> &mut Locals;
    fn insert_storage_live_stmt(&mut self, local: LocalId);
    fn insert_storage_dead_stmt(&mut self, local: LocalId);
    fn insert_assn_stmt(&mut self, place: Place, rvalue: Rvalue);
    fn get_ctx(&self) -> &TransformCtx;

    // Provided method
    fn fresh_var(&mut self, name: Option<String>, ty: Ty) -> Place { ... }
}
Expand description

A helper trait that captures the usual operation in body transformation.

Required Methods§

Source

fn get_locals_mut(&mut self) -> &mut Locals

Create a local & return the place pointing to it

Source

fn insert_storage_live_stmt(&mut self, local: LocalId)

Source

fn insert_storage_dead_stmt(&mut self, local: LocalId)

Source

fn insert_assn_stmt(&mut self, place: Place, rvalue: Rvalue)

Source

fn get_ctx(&self) -> &TransformCtx

Provided Methods§

Source

fn fresh_var(&mut self, name: Option<String>, ty: Ty) -> Place

Implementors§