Trait rustc_mir::dataflow::framework::GenKillAnalysis[][src]

pub trait GenKillAnalysis<'tcx>: Analysis<'tcx> {
    type Idx: Idx;
    fn statement_effect(
        &self,
        trans: &mut impl GenKill<Self::Idx>,
        statement: &Statement<'tcx>,
        location: Location
    );
fn terminator_effect(
        &self,
        trans: &mut impl GenKill<Self::Idx>,
        terminator: &Terminator<'tcx>,
        location: Location
    );
fn call_return_effect(
        &self,
        trans: &mut impl GenKill<Self::Idx>,
        block: BasicBlock,
        func: &Operand<'tcx>,
        args: &[Operand<'tcx>],
        return_place: Place<'tcx>
    ); fn before_statement_effect(
        &self,
        _trans: &mut impl GenKill<Self::Idx>,
        _statement: &Statement<'tcx>,
        _location: Location
    ) { ... }
fn before_terminator_effect(
        &self,
        _trans: &mut impl GenKill<Self::Idx>,
        _terminator: &Terminator<'tcx>,
        _location: Location
    ) { ... }
fn yield_resume_effect(
        &self,
        _trans: &mut impl GenKill<Self::Idx>,
        _resume_block: BasicBlock,
        _resume_place: Place<'tcx>
    ) { ... }
fn switch_int_edge_effects<G: GenKill<Self::Idx>>(
        &self,
        _block: BasicBlock,
        _discr: &Operand<'tcx>,
        _edge_effects: &mut impl SwitchIntEdgeEffects<G>
    ) { ... } }
Expand description

A gen/kill dataflow problem.

Each method in this trait has a corresponding one in Analysis. However, these methods only allow modification of the dataflow state via “gen” and “kill” operations. By defining transfer functions for each statement in this way, the transfer function for an entire basic block can be computed efficiently.

Analysis is automatically implemented for all implementers of GenKillAnalysis.

Associated Types

type Idx: Idx[src]

Required methods

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    statement: &Statement<'tcx>,
    location: Location
)
[src]

Expand description

See Analysis::apply_statement_effect.

fn terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    terminator: &Terminator<'tcx>,
    location: Location
)
[src]

Expand description

See Analysis::apply_terminator_effect.

fn call_return_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    block: BasicBlock,
    func: &Operand<'tcx>,
    args: &[Operand<'tcx>],
    return_place: Place<'tcx>
)
[src]

Expand description

See Analysis::apply_call_return_effect.

Provided methods

fn before_statement_effect(
    &self,
    _trans: &mut impl GenKill<Self::Idx>,
    _statement: &Statement<'tcx>,
    _location: Location
)
[src]

Expand description

See Analysis::apply_before_statement_effect.

fn before_terminator_effect(
    &self,
    _trans: &mut impl GenKill<Self::Idx>,
    _terminator: &Terminator<'tcx>,
    _location: Location
)
[src]

Expand description

See Analysis::apply_before_terminator_effect.

fn yield_resume_effect(
    &self,
    _trans: &mut impl GenKill<Self::Idx>,
    _resume_block: BasicBlock,
    _resume_place: Place<'tcx>
)
[src]

Expand description

See Analysis::apply_yield_resume_effect.

fn switch_int_edge_effects<G: GenKill<Self::Idx>>(
    &self,
    _block: BasicBlock,
    _discr: &Operand<'tcx>,
    _edge_effects: &mut impl SwitchIntEdgeEffects<G>
)
[src]

Expand description

See Analysis::apply_switch_int_edge_effects.

Implementors

impl<'mir, 'tcx> GenKillAnalysis<'tcx> for MaybeRequiresStorage<'mir, 'tcx>[src]

type Idx = Local

fn before_statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    stmt: &Statement<'tcx>,
    loc: Location
)
[src]

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _: &Statement<'tcx>,
    loc: Location
)
[src]

fn before_terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    terminator: &Terminator<'tcx>,
    loc: Location
)
[src]

fn terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    terminator: &Terminator<'tcx>,
    loc: Location
)
[src]

fn call_return_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _block: BasicBlock,
    _func: &Operand<'tcx>,
    _args: &[Operand<'tcx>],
    return_place: Place<'tcx>
)
[src]

fn yield_resume_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _resume_block: BasicBlock,
    resume_place: Place<'tcx>
)
[src]

impl<'tcx> GenKillAnalysis<'tcx> for Borrows<'_, 'tcx>[src]

type Idx = BorrowIndex

fn before_statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _statement: &Statement<'tcx>,
    location: Location
)
[src]

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    stmt: &Statement<'tcx>,
    location: Location
)
[src]

fn before_terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _terminator: &Terminator<'tcx>,
    location: Location
)
[src]

fn terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    teminator: &Terminator<'tcx>,
    _location: Location
)
[src]

fn call_return_effect(
    &self,
    _trans: &mut impl GenKill<Self::Idx>,
    _block: BasicBlock,
    _func: &Operand<'tcx>,
    _args: &[Operand<'tcx>],
    _dest_place: Place<'tcx>
)
[src]

impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedLocals[src]

fn yield_resume_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _resume_block: BasicBlock,
    resume_place: Place<'tcx>
)
[src]

See Analysis::apply_yield_resume_effect.

type Idx = Local

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    statement: &Statement<'tcx>,
    loc: Location
)
[src]

fn terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    terminator: &Terminator<'tcx>,
    loc: Location
)
[src]

fn call_return_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _block: BasicBlock,
    _func: &Operand<'tcx>,
    _args: &[Operand<'tcx>],
    return_place: Place<'tcx>
)
[src]

impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveLocals[src]

type Idx = Local

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    statement: &Statement<'tcx>,
    location: Location
)
[src]

fn terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    terminator: &Terminator<'tcx>,
    location: Location
)
[src]

fn call_return_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _block: BasicBlock,
    _func: &Operand<'tcx>,
    _args: &[Operand<'tcx>],
    dest_place: Place<'tcx>
)
[src]

fn yield_resume_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _resume_block: BasicBlock,
    resume_place: Place<'tcx>
)
[src]

impl<'tcx> GenKillAnalysis<'tcx> for MaybeStorageLive[src]

type Idx = Local

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    stmt: &Statement<'tcx>,
    _: Location
)
[src]

fn terminator_effect(
    &self,
    _trans: &mut impl GenKill<Self::Idx>,
    _: &Terminator<'tcx>,
    _: Location
)
[src]

fn call_return_effect(
    &self,
    _trans: &mut impl GenKill<Self::Idx>,
    _block: BasicBlock,
    _func: &Operand<'tcx>,
    _args: &[Operand<'tcx>],
    _return_place: Place<'tcx>
)
[src]

impl<'tcx> GenKillAnalysis<'tcx> for DefinitelyInitializedPlaces<'_, 'tcx>[src]

type Idx = MovePathIndex

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _statement: &Statement<'tcx>,
    location: Location
)
[src]

fn terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _terminator: &Terminator<'tcx>,
    location: Location
)
[src]

fn call_return_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _block: BasicBlock,
    _func: &Operand<'tcx>,
    _args: &[Operand<'tcx>],
    dest_place: Place<'tcx>
)
[src]

impl<'tcx> GenKillAnalysis<'tcx> for EverInitializedPlaces<'_, 'tcx>[src]

type Idx = InitIndex

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    stmt: &Statement<'tcx>,
    location: Location
)
[src]

fn terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _terminator: &Terminator<'tcx>,
    location: Location
)
[src]

fn call_return_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    block: BasicBlock,
    _func: &Operand<'tcx>,
    _args: &[Operand<'tcx>],
    _dest_place: Place<'tcx>
)
[src]

impl<'tcx> GenKillAnalysis<'tcx> for MaybeInitializedPlaces<'_, 'tcx>[src]

type Idx = MovePathIndex

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _statement: &Statement<'tcx>,
    location: Location
)
[src]

fn terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _terminator: &Terminator<'tcx>,
    location: Location
)
[src]

fn call_return_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _block: BasicBlock,
    _func: &Operand<'tcx>,
    _args: &[Operand<'tcx>],
    dest_place: Place<'tcx>
)
[src]

fn switch_int_edge_effects<G: GenKill<Self::Idx>>(
    &self,
    block: BasicBlock,
    discr: &Operand<'tcx>,
    edge_effects: &mut impl SwitchIntEdgeEffects<G>
)
[src]

impl<'tcx> GenKillAnalysis<'tcx> for MaybeUninitializedPlaces<'_, 'tcx>[src]

type Idx = MovePathIndex

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _statement: &Statement<'tcx>,
    location: Location
)
[src]

fn terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _terminator: &Terminator<'tcx>,
    location: Location
)
[src]

fn call_return_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    _block: BasicBlock,
    _func: &Operand<'tcx>,
    _args: &[Operand<'tcx>],
    dest_place: Place<'tcx>
)
[src]

fn switch_int_edge_effects<G: GenKill<Self::Idx>>(
    &self,
    block: BasicBlock,
    discr: &Operand<'tcx>,
    edge_effects: &mut impl SwitchIntEdgeEffects<G>
)
[src]

impl<K, 'tcx> GenKillAnalysis<'tcx> for MaybeBorrowedLocals<K> where
    K: BorrowAnalysisKind<'tcx>, 
[src]

type Idx = Local

fn statement_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    statement: &Statement<'tcx>,
    location: Location
)
[src]

fn terminator_effect(
    &self,
    trans: &mut impl GenKill<Self::Idx>,
    terminator: &Terminator<'tcx>,
    location: Location
)
[src]

fn call_return_effect(
    &self,
    _trans: &mut impl GenKill<Self::Idx>,
    _block: BasicBlock,
    _func: &Operand<'tcx>,
    _args: &[Operand<'tcx>],
    _dest_place: Place<'tcx>
)
[src]