struct FilterInformation<'a, 'tcx> {
body: &'a Body<'tcx>,
points: &'a DenseLocationMap,
live: &'a SparseIntervalMatrix<Local, PointIndex>,
candidates: &'a mut Candidates,
write_info: &'a mut WriteInfo,
at: Location,
}
Fields§
§body: &'a Body<'tcx>
§points: &'a DenseLocationMap
§live: &'a SparseIntervalMatrix<Local, PointIndex>
§candidates: &'a mut Candidates
§write_info: &'a mut WriteInfo
§at: Location
Implementations§
Source§impl<'a, 'tcx> FilterInformation<'a, 'tcx>
impl<'a, 'tcx> FilterInformation<'a, 'tcx>
Sourcefn filter_liveness(
candidates: &mut Candidates,
points: &DenseLocationMap,
live: &SparseIntervalMatrix<Local, PointIndex>,
write_info: &mut WriteInfo,
body: &Body<'tcx>,
)
fn filter_liveness( candidates: &mut Candidates, points: &DenseLocationMap, live: &SparseIntervalMatrix<Local, PointIndex>, write_info: &mut WriteInfo, body: &Body<'tcx>, )
Filters the set of candidates to remove those that conflict.
The steps we take are exactly those that are outlined at the top of the file. For each statement/terminator, we collect the set of locals that are written to in that statement/terminator, and then we remove all pairs of candidates that contain one such local and another one that is live.
We need to be careful about the ordering of operations within each statement/terminator
here. Many statements might write and read from more than one place, and we need to consider
them all. The strategy for doing this is as follows: We first gather all the places that are
written to within the statement/terminator via WriteInfo
. Then, we use the liveness
analysis from before the statement/terminator (in the control flow sense) to eliminate
candidates - this is because we want to conservatively treat a pair of locals that is both
read and written in the statement/terminator to be conflicting, and the liveness analysis
before the statement/terminator will correctly report locals that are read in the
statement/terminator to be live. We are additionally conservative by treating all written to
locals as also being read from.
fn internal_filter_liveness(&mut self)
fn apply_conflicts(&mut self)
Auto Trait Implementations§
impl<'a, 'tcx> DynSend for FilterInformation<'a, 'tcx>
impl<'a, 'tcx> DynSync for FilterInformation<'a, 'tcx>
impl<'a, 'tcx> Freeze for FilterInformation<'a, 'tcx>
impl<'a, 'tcx> !RefUnwindSafe for FilterInformation<'a, 'tcx>
impl<'a, 'tcx> Send for FilterInformation<'a, 'tcx>
impl<'a, 'tcx> Sync for FilterInformation<'a, 'tcx>
impl<'a, 'tcx> Unpin for FilterInformation<'a, 'tcx>
impl<'a, 'tcx> !UnwindSafe for FilterInformation<'a, 'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes