[−][src]Struct rustc_mir::transform::dest_prop::Conflicts

pub(in transform::dest_prop) struct Conflicts<'a> {
    relevant_locals: &'a BitSet<Local>,
    matrix: BitMatrix<Local, Local>,
    unify_cache: BitSet<Local>,
    unified_locals: InPlaceUnificationTable<UnifyLocal>,
}

Fields

relevant_locals: &'a BitSet<Local>matrix: BitMatrix<Local, Local>

The conflict matrix. It is always symmetric and the adjacency matrix of the corresponding conflict graph.

unify_cache: BitSet<Local>

Preallocated BitSet used by unify.

unified_locals: InPlaceUnificationTable<UnifyLocal>

Tracks locals that have been merged together to prevent cycles and propagate conflicts.

Implementations

impl<'a> Conflicts<'a>[src]

pub(in transform::dest_prop) fn build<'tcx>(
    tcx: TyCtxt<'tcx>,
    body: &Body<'tcx>,
    relevant_locals: &'a BitSet<Local>
) -> Self
[src]

pub(in transform::dest_prop) fn record_dataflow_conflicts(
    &mut self,
    new_conflicts: &mut BitSet<Local>
)
[src]

pub(in transform::dest_prop) fn record_local_conflict(
    &mut self,
    a: Local,
    b: Local,
    why: &str
)
[src]

pub(in transform::dest_prop) fn record_statement_conflicts(
    &mut self,
    stmt: &Statement<'_>
)
[src]

Records locals that must not overlap during the evaluation of stmt. These locals conflict and must not be merged.

pub(in transform::dest_prop) fn record_terminator_conflicts(
    &mut self,
    term: &Terminator<'_>
)
[src]

pub(in transform::dest_prop) fn can_unify(
    &mut self,
    a: Local,
    b: Local
) -> bool
[src]

Checks whether a and b may be merged. Returns false if there's a conflict.

pub(in transform::dest_prop) fn unify(
    &mut self,
    a: Local,
    b: Local
)
[src]

Merges the conflicts of a and b, so that each one inherits all conflicts of the other.

can_unify must have returned true for the same locals, or this may panic or lead to miscompiles.

This is called when the pass makes the decision to unify a and b (or parts of a and b) and is needed to ensure that future unification decisions take potentially newly introduced conflicts into account.

For an example, assume we have locals _0, _1, _2, and _3. There are these conflicts:

  • _0 <-> _1
  • _1 <-> _2
  • _3 <-> _0

We then decide to merge _2 with _3 since they don't conflict. Then we decide to merge _2 with _0, which also doesn't have a conflict in the above list. However _2 is now _3, which does conflict with _0.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Conflicts<'a>

impl<'a> Send for Conflicts<'a>

impl<'a> Sync for Conflicts<'a>

impl<'a> Unpin for Conflicts<'a>

impl<'a> UnwindSafe for Conflicts<'a>

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> WithConstness for T[src]