pub enum Arg {
Register {
expr: Expression,
data_type: Option<Datatype>,
},
Stack {
address: Expression,
size: ByteSize,
data_type: Option<Datatype>,
},
}
Expand description
A parameter or return argument of a function.
Variants§
Register
Fields
§
expr: Expression
The expression evaluating to the argument.
The argument is passed in a register
Stack
Fields
§
address: Expression
The expression that computes the address of the argument on the stack.
The argument is passed on the stack.
Implementations§
source§impl Arg
impl Arg
sourcepub fn from_var(var: Variable, data_type_hint: Option<Datatype>) -> Arg
pub fn from_var(var: Variable, data_type_hint: Option<Datatype>) -> Arg
Generate a new register argument.
sourcepub fn get_data_type(&self) -> Option<Datatype>
pub fn get_data_type(&self) -> Option<Datatype>
Returns the data type field of an Arg object.
sourcepub fn eval_stack_offset(&self) -> Result<Bitvector, Error>
pub fn eval_stack_offset(&self) -> Result<Bitvector, Error>
If the argument is a stack argument, return its offset relative to the current stack register value. Return an error for register arguments or if the offset could not be computed.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Arg
impl<'de> Deserialize<'de> for Arg
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Arg
impl StructuralEq for Arg
impl StructuralPartialEq for Arg
Auto Trait Implementations§
impl RefUnwindSafe for Arg
impl Send for Arg
impl Sync for Arg
impl Unpin for Arg
impl UnwindSafe for Arg
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.