pub struct Function {
pub sig: Signature,
pub blocks: Vec<Block>,
pub entry: String,
}Expand description
LUMIR function
Fields§
§sig: SignatureFunction signature
blocks: Vec<Block>Basic blocks (ordered map for deterministic iteration)
entry: StringEntry block label
Implementations§
Source§impl Function
impl Function
Sourcepub fn with_entry(self, entry: impl Into<String>) -> Self
pub fn with_entry(self, entry: impl Into<String>) -> Self
Set the entry block label
Sourcepub fn get_block_mut(&mut self, label: &str) -> Option<&mut Block>
pub fn get_block_mut(&mut self, label: &str) -> Option<&mut Block>
Get a mutable reference to a basic block by label
Sourcepub fn entry_block(&self) -> Option<&Block>
pub fn entry_block(&self) -> Option<&Block>
Get the entry block
Sourcepub fn entry_block_mut(&mut self) -> Option<&mut Block>
pub fn entry_block_mut(&mut self) -> Option<&mut Block>
Get a mutable reference to the entry block
Sourcepub fn block_labels(&self) -> Vec<&str>
pub fn block_labels(&self) -> Vec<&str>
Get all block labels
Sourcepub fn instruction_count(&self) -> usize
pub fn instruction_count(&self) -> usize
Total number of instructions across all blocks
Trait Implementations§
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin 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