rustc_mir_dataflow::framework

Trait AnalysisDomain

source
pub trait AnalysisDomain<'tcx> {
    type Domain: Clone + JoinSemiLattice;
    type Direction: Direction = Forward;

    const NAME: &'static str;

    // Required methods
    fn bottom_value(&self, body: &Body<'tcx>) -> Self::Domain;
    fn initialize_start_block(
        &self,
        body: &Body<'tcx>,
        state: &mut Self::Domain,
    );
}
Expand description

Defines the domain of a dataflow problem.

This trait specifies the lattice on which this analysis operates (the domain) as well as its initial value at the entry point of each basic block.

Required Associated Constants§

source

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.

Required Associated Types§

source

type Domain: Clone + JoinSemiLattice

The type that holds the dataflow state at any given point in the program.

Provided Associated Types§

source

type Direction: Direction = Forward

The direction of this analysis. Either Forward or Backward.

Required Methods§

source

fn bottom_value(&self, body: &Body<'tcx>) -> Self::Domain

Returns the initial value of the dataflow state upon entry to each basic block.

source

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

Mutates the initial value of the dataflow state upon entry to the START_BLOCK.

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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, 'tcx> AnalysisDomain<'tcx> for DefinitelyInitializedPlaces<'a, 'tcx>

source§

const NAME: &'static str = "definite_init"

source§

type Domain = Dual<BitSet<MovePathIndex>>

source§

impl<'a, 'tcx> AnalysisDomain<'tcx> for MaybeTransitiveLiveLocals<'a>

source§

const NAME: &'static str = "transitive liveness"

source§

type Domain = BitSet<Local>

source§

type Direction = Backward

source§

impl<'a, 'tcx> AnalysisDomain<'tcx> for MaybeStorageDead<'a>

source§

const NAME: &'static str = "maybe_storage_dead"

source§

type Domain = BitSet<Local>

source§

impl<'a, 'tcx> AnalysisDomain<'tcx> for MaybeStorageLive<'a>

source§

const NAME: &'static str = "maybe_storage_live"

source§

type Domain = BitSet<Local>

source§

impl<'tcx> AnalysisDomain<'tcx> for MaybeBorrowedLocals

source§

const NAME: &'static str = "maybe_borrowed_locals"

source§

type Domain = BitSet<Local>

source§

impl<'tcx> AnalysisDomain<'tcx> for EverInitializedPlaces<'_, 'tcx>

source§

const NAME: &'static str = "ever_init"

source§

type Domain = ChunkedBitSet<InitIndex>

source§

impl<'tcx> AnalysisDomain<'tcx> for MaybeInitializedPlaces<'_, 'tcx>

source§

impl<'tcx> AnalysisDomain<'tcx> for MaybeUninitializedPlaces<'_, 'tcx>

source§

const NAME: &'static str = "maybe_uninit"

source§

type Domain = ChunkedBitSet<MovePathIndex>

source§

impl<'tcx> AnalysisDomain<'tcx> for MaybeLiveLocals

source§

const NAME: &'static str = "liveness"

source§

type Domain = BitSet<Local>

source§

type Direction = Backward

source§

impl<'tcx> AnalysisDomain<'tcx> for MaybeRequiresStorage<'_, 'tcx>

source§

const NAME: &'static str = "requires_storage"

source§

type Domain = BitSet<Local>

source§

impl<'tcx, T: ValueAnalysis<'tcx>> AnalysisDomain<'tcx> for ValueAnalysisWrapper<T>

source§

const NAME: &'static str = T::NAME

source§

type Domain = State<<T as ValueAnalysis<'tcx>>::Value>