pub struct Parameter {
pub reg: Register,
pub ty: MirType,
pub signedness: Signedness,
pub aggregate: Option<Aggregate>,
pub name: Option<String>,
pub byval_claimed: bool,
}Expand description
Function parameter
Fields§
§reg: RegisterVirtual register assigned to this parameter
ty: MirTypeType of the parameter
signedness: SignednessSignedness of an integer parameter
aggregate: Option<Aggregate>Set when the parameter is an aggregate passed by value. reg then names the
frame slot holding the callee’s copy, and ty is the pointer to it.
name: Option<String>The name the parameter had in the source, without its sigil. Debug info only;
None where the frontend supplied none.
byval_claimed: boolSet by a byval attribute the frontend stated and lowering verified against its
own classification. A backend that does not place this parameter as a by-value
stack copy must refuse rather than place it some other way.
Implementations§
Source§impl Parameter
impl Parameter
Sourcepub fn new(reg: Register, ty: MirType) -> Self
pub fn new(reg: Register, ty: MirType) -> Self
Creates a signed parameter that is not an aggregate; chain with_signedness or
with_aggregate for others.
pub fn with_signedness(self, signedness: Signedness) -> Self
pub fn with_aggregate(self, aggregate: Aggregate) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_byval_claim(self, claimed: bool) -> Self
Trait Implementations§
impl StructuralPartialEq for Parameter
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnsafeUnpin for Parameter
impl UnwindSafe for Parameter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more