flux_refineck::ghost_statements::points_to

Struct State

Source
struct State {
    values: IndexVec<ValueIndex, FlatSet<Loc>>,
}
Expand description

The dataflow state for the PointsToAnalysis.

Every instance specifies a lattice that represents the possible values of a single tracked place. If we call this lattice V and set of tracked places P, then a State is an element of {unreachable} ∪ (P -> V). This again forms a lattice, where the bottom element is unreachable and the top element is the mapping p ↦ ⊤. Note that the mapping p ↦ ⊥ is not the bottom element (because joining an unreachable and any other reachable state yields a reachable state). All operations on unreachable states are ignored.

Flooding means assigning a value (by default ) to all tracked projections of a given place.

Fields§

§values: IndexVec<ValueIndex, FlatSet<Loc>>

Implementations§

Source§

impl State

Source

fn flood(&mut self, place: PlaceRef<'_>, map: &Map)

Source

fn flood_with(&mut self, place: PlaceRef<'_>, map: &Map, value: FlatSet<Loc>)

Source

fn assign(&mut self, target: PlaceRef<'_>, result: PlaceOrValue, map: &Map)

Helper method to interpret target = result.

Source

fn insert_idx(&mut self, target: PlaceIndex, result: PlaceOrValue, map: &Map)

Low-level method that assigns to a place. This does nothing if the place is not tracked.

The target place must have been flooded before calling this method.

Source

fn insert_place_idx( &mut self, target: PlaceIndex, source: PlaceIndex, map: &Map, )

Copies source to target, including all tracked places beneath.

If target contains a place that is not contained in source, it will be overwritten with Top. Also, because this will copy all entries one after another, it may only be used for places that are non-overlapping or identical.

The target place must have been flooded before calling this method.

Source

fn insert_value_idx( &mut self, target: PlaceIndex, value: FlatSet<Loc>, map: &Map, )

Low-level method that assigns a value to a place. This does nothing if the place is not tracked.

The target place must have been flooded before calling this method.

Source

fn get(&self, place: PlaceRef<'_>, map: &Map) -> FlatSet<Loc>

Retrieve the value stored for a place, or ⊤ if it is not tracked.

Source

fn get_idx(&self, place: PlaceIndex, map: &Map) -> FlatSet<Loc>

Retrieve the value stored for a place index, or ⊤ if it is not tracked.

Source

fn get_tracked_idx(&self, place: PlaceIndex, map: &Map) -> Option<FlatSet<Loc>>

Retrieve the value stored for a place index if tracked

Trait Implementations§

Source§

impl Clone for State

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for State

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DebugWithContext<PointsToAnalysis<'_>> for State

This is used to visualize the dataflow analysis.

Source§

fn fmt_with(&self, ctxt: &PointsToAnalysis<'_>, f: &mut Formatter<'_>) -> Result

Source§

fn fmt_diff_with( &self, old: &Self, ctxt: &PointsToAnalysis<'_>, f: &mut Formatter<'_>, ) -> Result

Print the difference between self and old. Read more
Source§

impl JoinSemiLattice for State

Source§

fn join(&mut self, other: &Self) -> bool

Computes the least upper bound of two elements, storing the result in self and returning true if self has changed. Read more
Source§

impl PartialEq for State

Source§

fn eq(&self, other: &State) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for State

Source§

impl StructuralPartialEq for State

Auto Trait Implementations§

§

impl Freeze for State

§

impl RefUnwindSafe for State

§

impl Send for State

§

impl Sync for State

§

impl Unpin for State

§

impl UnwindSafe for State

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more