Struct cranelift_codegen::binemit::RegDiversions
source · [−]pub struct RegDiversions { /* private fields */ }Expand description
Keep track of diversions in a block.
Implementations
sourceimpl RegDiversions
impl RegDiversions
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the content of the diversions, to reset the state of the compiler.
sourcepub fn diversion(&self, value: Value) -> Option<&Diversion>
pub fn diversion(&self, value: Value) -> Option<&Diversion>
Get the current diversion of value, if any.
sourcepub fn get(&self, value: Value, locations: &ValueLocations) -> ValueLoc
pub fn get(&self, value: Value, locations: &ValueLocations) -> ValueLoc
Get the current location for value. Fall back to the assignment map for non-diverted
values
sourcepub fn reg(&self, value: Value, locations: &ValueLocations) -> RegUnit
pub fn reg(&self, value: Value, locations: &ValueLocations) -> RegUnit
Get the current register location for value, or panic if value isn’t in a register.
sourcepub fn stack(&self, value: Value, locations: &ValueLocations) -> StackSlot
pub fn stack(&self, value: Value, locations: &ValueLocations) -> StackSlot
Get the current stack location for value, or panic if value isn’t in a stack slot.
sourcepub fn regmove(&mut self, value: Value, from: RegUnit, to: RegUnit)
pub fn regmove(&mut self, value: Value, from: RegUnit, to: RegUnit)
Record a register -> register move.
sourcepub fn regspill(&mut self, value: Value, from: RegUnit, to: StackSlot)
pub fn regspill(&mut self, value: Value, from: RegUnit, to: StackSlot)
Record a register -> stack move.
sourcepub fn regfill(&mut self, value: Value, from: StackSlot, to: RegUnit)
pub fn regfill(&mut self, value: Value, from: StackSlot, to: RegUnit)
Record a stack -> register move.
sourcepub fn apply(&mut self, inst: &InstructionData)
pub fn apply(&mut self, inst: &InstructionData)
Apply the effect of inst.
If inst is a regmove, regfill, or regspill instruction, update the diversions to
match.
sourcepub fn remove(&mut self, value: Value) -> Option<ValueLoc>
pub fn remove(&mut self, value: Value) -> Option<ValueLoc>
Drop any recorded move for value.
Returns the to location of the removed diversion.
sourcepub fn at_block(&mut self, entry_diversions: &EntryRegDiversions, block: Block)
pub fn at_block(&mut self, entry_diversions: &EntryRegDiversions, block: Block)
Resets the state of the current diversions to the recorded diversions at the entry of the
given block. The recoded diversions is available after coloring on func.entry_diversions
field.
sourcepub fn save_for_block(
&mut self,
entry_diversions: &mut EntryRegDiversions,
target: Block
)
pub fn save_for_block(
&mut self,
entry_diversions: &mut EntryRegDiversions,
target: Block
)
Copy the current state of the diversions, and save it for the entry of the block given as
argument.
Note: This function can only be called once on a Block with a given entry_diversions
argument, otherwise it would panic.
sourcepub fn check_block_entry(
&self,
entry_diversions: &EntryRegDiversions,
target: Block
) -> bool
pub fn check_block_entry(
&self,
entry_diversions: &EntryRegDiversions,
target: Block
) -> bool
Check that the recorded entry for a given block matches what is recorded in the
entry_diversions.
Trait Implementations
sourceimpl Clone for RegDiversions
impl Clone for RegDiversions
sourcefn clone(&self) -> RegDiversions
fn clone(&self) -> RegDiversions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for RegDiversions
impl Send for RegDiversions
impl Sync for RegDiversions
impl Unpin for RegDiversions
impl UnwindSafe for RegDiversions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more