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

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

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

unify_cache: BitSet<Local>
Expand description

Preallocated BitSet used by unify.

unified_locals: InPlaceUnificationTable<UnifyLocal>
Expand description

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

Implementations

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

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

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

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

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.

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

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.

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

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

Performs the conversion.

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.

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

Performs the conversion.

impl<T> WithConstness for T[src]

fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]

fn with_const(self) -> ConstnessAnd<Self>[src]

fn without_const(self) -> ConstnessAnd<Self>[src]