pub struct Function {
pub variables: HashMap<String, AbiType>,
pub blocks: Vec<InstBlock>,
pub name: String,
pub signature: FunctionSignature,
}
Fields§
§variables: HashMap<String, AbiType>
§blocks: Vec<InstBlock>
A list of that blocks that may store instructions.
name: String
The name of the Function, used at compile time to generate correct code.
signature: FunctionSignature
The signature that the function uses.
Implementations§
Source§impl Function
impl Function
Sourcepub fn new(name: String, sig: FunctionSignature) -> Self
pub fn new(name: String, sig: FunctionSignature) -> Self
Creates a new function from the given name and signature.
Sourcepub fn declare_var(&mut self, name: String, var_type: AbiType) -> Variable
pub fn declare_var(&mut self, name: String, var_type: AbiType) -> Variable
Declares a variable at the start of the function.
Sourcepub fn create_block(&mut self) -> Block
pub fn create_block(&mut self) -> Block
Creates a new empty block.
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
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