pub struct NativeFunc {
pub name: String,
pub params: Vec<(Register, NativeType)>,
pub ret_type: NativeType,
pub blocks: Vec<BasicBlock>,
pub stack_size: usize,
pub is_recursive: bool,
}Expand description
A function in the native IR.
Fields§
§name: StringFunction name.
params: Vec<(Register, NativeType)>Parameter registers and types.
ret_type: NativeTypeReturn type.
blocks: Vec<BasicBlock>Basic blocks (entry is blocks[0]).
stack_size: usizeTotal stack size needed.
is_recursive: boolWhether this function is recursive.
Implementations§
Source§impl NativeFunc
impl NativeFunc
Sourcepub fn entry_block(&self) -> Option<&BasicBlock>
pub fn entry_block(&self) -> Option<&BasicBlock>
Get the entry block.
Sourcepub fn instruction_count(&self) -> usize
pub fn instruction_count(&self) -> usize
Total number of instructions across all blocks.
Sourcepub fn get_block(&self, id: BlockId) -> Option<&BasicBlock>
pub fn get_block(&self, id: BlockId) -> Option<&BasicBlock>
Get a block by ID.
Sourcepub fn virtual_registers(&self) -> HashSet<Register>
pub fn virtual_registers(&self) -> HashSet<Register>
Get all virtual registers used in this function.
Trait Implementations§
Source§impl Clone for NativeFunc
impl Clone for NativeFunc
Source§fn clone(&self) -> NativeFunc
fn clone(&self) -> NativeFunc
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NativeFunc
impl Debug for NativeFunc
Auto Trait Implementations§
impl Freeze for NativeFunc
impl RefUnwindSafe for NativeFunc
impl Send for NativeFunc
impl Sync for NativeFunc
impl Unpin for NativeFunc
impl UnsafeUnpin for NativeFunc
impl UnwindSafe for NativeFunc
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