Skip to main content

Allocation

Struct Allocation 

Source
pub struct Allocation {
    pub assignment: Assignment,
    pub edits: Vec<Edit>,
    pub order: Order,
    pub live: Live,
}
Expand description

What allocating a function produced.

The moves are handed back rather than written into the function because a move is an instruction and an instruction belongs to a target, which spec/10-backend.md section 10.8 says this crate holds nothing of. The consumer turns each one into whatever its target moves a register with.

Fields§

§assignment: Assignment

Where every value of the function went, which is what the frame layout reads.

§edits: Vec<Edit>

The moves the places do not already make true, in the order they have to be made in.

§order: Order

The line the function was laid out in while it was allocated, which the liveness below is counted along.

§live: Live

Where every value was live.

Handed back rather than dropped because the stack slot allocator shares one run of bytes between two things that are never both wanted, and the only liveness that knows where a spilled value is wanted is the one the spilling was decided from. Working a second one out afterwards would cost a pass and would be free to disagree with this one. spec/optimizer/36-lowering-and-isel.md section 36.7 asks for the one answer.

Trait Implementations§

Source§

impl Clone for Allocation

Source§

fn clone(&self) -> Allocation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Allocation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.