pub struct Changes { /* private fields */ }Expand description
A set of changes to one function, proposed together and taken together.
The order proposals are added in is the order they are applied in, which matters only for the reading of a commit that both rewrites and removes: nothing here depends on it, since a plan says what an instruction becomes rather than what to do to what it is.
Implementations§
Source§impl Changes
impl Changes
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
How many changes the set is about, counting the edges along with the instructions.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the set is about nothing, which commits and changes nothing.
Sourcepub fn rename(&mut self, inst: Inst, from: Reg, into: Reg)
pub fn rename(&mut self, inst: Inst, from: Reg, into: Reg)
Proposes that the instruction read the second register wherever it reads the first.
Only where it reads it. What an instruction writes is what the rest of the function knows it by, and changing that is a different proposal from this one.
Sourcepub fn carry(&mut self, from: Block, at: usize, args: Vec<Reg>)
pub fn carry(&mut self, from: Block, at: usize, args: Vec<Reg>)
Proposes that the edge leaving that block carry those registers.
Which edge is its position in the block’s own list of them, which is what
mir::Func::succs_mut hands back and what the terminator’s conditions are written against.
Sourcepub fn refused(
&self,
func: &Func,
reads: &Reads,
names: &Interner,
machine: &MachineInsts,
) -> Option<Refusal>
pub fn refused( &self, func: &Func, reads: &Reads, names: &Interner, machine: &MachineInsts, ) -> Option<Refusal>
Why the set would not be taken, or None if it would.
Asked of the function as it stands and of the target’s description of itself. Nothing here changes anything, so a pass may ask, decide the answer is not worth having, and drop the set.