[][src]Trait gf::code::dfa::Interp

pub trait Interp<D: InterpDirection> {
    type State: Clone;
    fn edge(
        &self,
        state: Self::State,
        module: &Sealed<Module>,
        edge: &Edge
    ) -> Option<Self::State>;
fn call_entry(
        &self,
        state: Self::State,
        module: &Sealed<Module>,
        call: &Call
    ) -> Option<Self::State>;
fn call_exit(
        &self,
        state: Self::State,
        module: &Sealed<Module>,
        call: &Call
    ) -> Option<Self::State>;
fn init(
        &self,
        state: Self::State,
        module: &Sealed<Module>,
        init: &Init
    ) -> Option<Self::State>;
fn invoke(
        &self,
        state: Self::State,
        module: &Sealed<Module>,
        invoke: &Invoke
    ) -> Option<Self::State>;
fn load_local(
        &self,
        state: Self::State,
        module: &Sealed<Module>,
        load_local: &LoadLocal
    ) -> Option<Self::State>;
fn mix(
        &self,
        state: Self::State,
        module: &Sealed<Module>,
        mix: &Mix
    ) -> Option<Self::State>;
fn slice(
        &self,
        state: Self::State,
        module: &Sealed<Module>,
        slice: &Slice
    ) -> Option<Self::State>;
fn store_local(
        &self,
        state: Self::State,
        module: &Sealed<Module>,
        store_local: &StoreLocal
    ) -> Option<Self::State>; }

An abstract interpretation.

Each method of this trait is a transfer function that propagates abstract state across an edge, a statement, or part thereof. If a transfer function returns None, this is interpreted as an impossible state. If the state is a lattice, the interpretation must normalize bottom elements to None to maintain compatibility with all executors.

Associated Types

type State: Clone

Abstract state.

Loading content...

Required methods

fn edge(
    &self,
    state: Self::State,
    module: &Sealed<Module>,
    edge: &Edge
) -> Option<Self::State>

Propagate state across an edge.

Forward interpretation

The input state corresponds to the end of the basic block that edge originates from. The method must return the state at the start of the basic block that edge goes to.

Backward interpretation

The input state corresponds to the start of of the basic block that edge goes to. The method must return the state at the end of the basic block that edge originates from.

fn call_entry(
    &self,
    state: Self::State,
    module: &Sealed<Module>,
    call: &Call
) -> Option<Self::State>

Propagate state across a CALL statement entry.

fn call_exit(
    &self,
    state: Self::State,
    module: &Sealed<Module>,
    call: &Call
) -> Option<Self::State>

Propagate state across a CALL statement exit.

fn init(
    &self,
    state: Self::State,
    module: &Sealed<Module>,
    init: &Init
) -> Option<Self::State>

Propagate state across an INIT statement.

fn invoke(
    &self,
    state: Self::State,
    module: &Sealed<Module>,
    invoke: &Invoke
) -> Option<Self::State>

Propagate state across an INVOKE statement.

fn load_local(
    &self,
    state: Self::State,
    module: &Sealed<Module>,
    load_local: &LoadLocal
) -> Option<Self::State>

Propagate state across a LOAD.L statement.

fn mix(
    &self,
    state: Self::State,
    module: &Sealed<Module>,
    mix: &Mix
) -> Option<Self::State>

Propagate state across a MIX statement.

fn slice(
    &self,
    state: Self::State,
    module: &Sealed<Module>,
    slice: &Slice
) -> Option<Self::State>

Propagate state across a SLICE statement.

fn store_local(
    &self,
    state: Self::State,
    module: &Sealed<Module>,
    store_local: &StoreLocal
) -> Option<Self::State>

Propagate state across a STORE.L statement.

Loading content...

Implementors

impl Interp<Forward> for ConcreteInterp[src]

type State = ConcreteState

Loading content...