Skip to main content

Lowered

Struct Lowered 

Source
pub struct Lowered {
    pub func: Func,
    pub calls: Option<u32>,
}
Expand description

A lowered function, and the one thing about it the frame needs that the machine IR does not hold.

Fields§

§func: Func

The function, in machine instructions.

§calls: Option<u32>

How many bytes the widest call in the function needs below the stack pointer for the arguments it passes there, or None for a function that makes no call at all.

Both halves of that are what crate::frame::Layout asks for, and both are answered here because selection is where a call is built and nothing after it can tell what a call needed. None is a leaf, which is the function that may use the red zone and the one whose stack pointer does not have to be left aligned for anybody.

Implementations§

Source§

impl Lowered

Source

pub fn layout<'a>(&self, base: Layout<'a>) -> Layout<'a>

The layout given, with the two fields only the lowering knows the answer to filled in.

Everything else in a layout comes from the flags the function is compiled under or from the allocation, so this takes one and returns it rather than building one.

Trait Implementations§

Source§

impl Debug for Lowered

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> 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, 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.