pub struct Assignment { /* private fields */ }Expand description
Where every value in a function went.
Implementations§
Source§impl Assignment
impl Assignment
Sourcepub fn empty(vregs: usize) -> Self
pub fn empty(vregs: usize) -> Self
An assignment that says nothing yet about a function with that many values.
This and Assignment::put and Assignment::take_slot are how an allocator says what
it decided. There will be a second one in M4 and it will not reach its answer this way, so
what an assignment is has to be separable from how this file arrives at one, and the
checker in crate::check reads an assignment without caring which allocator wrote it.
Sourcepub fn put(&mut self, reg: Reg, place: Place)
pub fn put(&mut self, reg: Reg, place: Place)
Records where a value went.
§Panics
Panics on a physical register, which is somewhere already, and on a virtual one the function never handed out.
Sourcepub fn take_slot(&mut self, class: RegClass) -> u32
pub fn take_slot(&mut self, class: RegClass) -> u32
Takes a slot of the frame, of that class, and gives back which one it is.
§Panics
Panics past four billion slots, which is a frame no machine has room for.
Sourcepub fn place(&self, reg: Reg) -> Option<Place>
pub fn place(&self, reg: Reg) -> Option<Place>
Where a value lives, or None for a virtual register this function never mentions and for
a physical one, which is already where it is.
Trait Implementations§
Source§impl Clone for Assignment
impl Clone for Assignment
Source§fn clone(&self) -> Assignment
fn clone(&self) -> Assignment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more