[−][src]Trait rustc_mir::dataflow::framework::AnalysisDomain

pub trait AnalysisDomain<'tcx>: BottomValue {
    type Idx: Idx;
    type Direction: Direction = Forward;

    const NAME: &'static str;

    fn bits_per_block(&self, body: &Body<'tcx>) -> usize;
fn initialize_start_block(
        &self,
        body: &Body<'tcx>,
        state: &mut BitSet<Self::Idx>
    ); fn pretty_print_idx(&self, w: &mut impl Write, idx: Self::Idx) -> Result<()> { ... } }

Define the domain of a dataflow problem.

This trait specifies the lattice on which this analysis operates. For now, this must be a powerset of values of type Idx. The elements of this lattice are represented with a BitSet and referred to as the state vector.

This trait also defines the initial value for the dataflow state upon entry to the START_BLOCK, as well as some names used to refer to this analysis when debugging.

Associated Types

type Idx: Idx

The type of the elements in the state vector.

type Direction: Direction = Forward

The direction of this analyis. Either Forward or Backward.

Loading content...

Associated Constants

const NAME: &'static str

A descriptive name for this analysis. Used only for debugging.

This name should be brief and contain no spaces, periods or other characters that are not suitable as part of a filename.

Loading content...

Required methods

fn bits_per_block(&self, body: &Body<'tcx>) -> usize

The size of the state vector.

fn initialize_start_block(
    &self,
    body: &Body<'tcx>,
    state: &mut BitSet<Self::Idx>
)

Mutates the entry set of the START_BLOCK to contain the initial state for dataflow analysis.

For backward analyses, initial state besides the bottom value is not yet supported. Trying to mutate the initial state will result in a panic.

Loading content...

Provided methods

fn pretty_print_idx(&self, w: &mut impl Write, idx: Self::Idx) -> Result<()>

Prints an element in the state vector for debugging.

Loading content...

Implementors

impl<'a, 'tcx> AnalysisDomain<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx>[src]

type Idx = MovePathIndex

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

type Idx = Local

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

type Idx = Local

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

type Idx = Local

type Direction = Backward

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

type Idx = Local

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

type Idx = BorrowIndex

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

type Idx = InitIndex

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

type Idx = MovePathIndex

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

type Idx = MovePathIndex

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

type Idx = Local

impl<Q, 'tcx, '_, '_> AnalysisDomain<'tcx> for FlowSensitiveAnalysis<'_, '_, 'tcx, Q> where
    Q: Qualif, 
[src]

type Idx = Local

Loading content...