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 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 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 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>

§

type Domain = Dual<BitSet<MovePathIndex>>

source§

const NAME: &'static str = "definite_init"

source§

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

§

type Domain = BitSet<Local>

§

type Direction = Backward

source§

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

source§

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

§

type Domain = BitSet<Local>

source§

const NAME: &'static str = "maybe_borrowed_locals"

source§

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

§

type Domain = ChunkedBitSet<InitIndex>

source§

const NAME: &'static str = "ever_init"

source§

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

§

type Domain = MaybeReachable<ChunkedBitSet<MovePathIndex>>

source§

const NAME: &'static str = "maybe_init"

source§

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

§

type Domain = ChunkedBitSet<MovePathIndex>

source§

const NAME: &'static str = "maybe_uninit"

source§

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

§

type Domain = BitSet<Local>

§

type Direction = Backward

source§

const NAME: &'static str = "liveness"

source§

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

§

type Domain = BitSet<Local>

source§

const NAME: &'static str = "requires_storage"

source§

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

§

type Domain = BitSet<Local>

source§

const NAME: &'static str = "maybe_storage_dead"

source§

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

§

type Domain = BitSet<Local>

source§

const NAME: &'static str = "maybe_storage_live"

source§

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

§

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

source§

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