pub struct MirFunction {
pub name: String,
pub params: Vec<MirParam>,
pub blocks: Vec<BasicBlock>,
pub entry: BlockId,
pub value_types: HashMap<ValueId, MirType>,
}Expand description
A function/kernel in MIR with a control flow graph.
Fields§
§name: StringKernel name.
params: Vec<MirParam>Kernel parameters.
blocks: Vec<BasicBlock>Basic blocks forming the CFG.
entry: BlockIdEntry block ID.
value_types: HashMap<ValueId, MirType>Type mapping for all SSA values.
Implementations§
Source§impl MirFunction
impl MirFunction
Sourcepub fn block(&self, id: BlockId) -> Option<&BasicBlock>
pub fn block(&self, id: BlockId) -> Option<&BasicBlock>
Get a basic block by ID.
Sourcepub fn block_mut(&mut self, id: BlockId) -> Option<&mut BasicBlock>
pub fn block_mut(&mut self, id: BlockId) -> Option<&mut BasicBlock>
Get a mutable reference to a basic block by ID.
Sourcepub fn block_count(&self) -> usize
pub fn block_count(&self) -> usize
Returns the number of basic blocks.
Trait Implementations§
Source§impl Clone for MirFunction
impl Clone for MirFunction
Source§fn clone(&self) -> MirFunction
fn clone(&self) -> MirFunction
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 MirFunction
impl Debug for MirFunction
Auto Trait Implementations§
impl Freeze for MirFunction
impl RefUnwindSafe for MirFunction
impl Send for MirFunction
impl Sync for MirFunction
impl Unpin for MirFunction
impl UnsafeUnpin for MirFunction
impl UnwindSafe for MirFunction
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