pub struct BlockRef<'str, 'ctx, R = ModuleView<'ctx, 'str>> {
pub id: BlockId,
/* private fields */
}Fields§
§id: BlockIdImplementations§
Source§impl<'s, 'ctx: 's, 'str: 'ctx, R> BlockRef<'str, 'ctx, R>where
R: QCodeView<'ctx, 'str>,
impl<'s, 'ctx: 's, 'str: 'ctx, R> BlockRef<'str, 'ctx, R>where
R: QCodeView<'ctx, 'str>,
Sourcepub fn successors(&'s self) -> impl Iterator<Item = (EdgeId, BlockId)> + 's
pub fn successors(&'s self) -> impl Iterator<Item = (EdgeId, BlockId)> + 's
Iterates over outgoing (edge_id, successor_block_id) pairs.
Routed through its QCodeView (this block’s incident edge set and each edge’s
endpoints) rather than the jstd graph traits, so it reads correctly when
the owning function is checked out. On the module path it yields exactly
what Node::children did: the same incident-edge set, filtered to edges
leaving this block.
Sourcepub fn predecessors(&'s self) -> impl Iterator<Item = (EdgeId, BlockId)> + 's
pub fn predecessors(&'s self) -> impl Iterator<Item = (EdgeId, BlockId)> + 's
Iterates over incoming (edge_id, predecessor_block_id) pairs. See
successors for the routing rationale.
pub fn name(&'s self) -> Option<&'ctx str>
Sourcepub fn address(&'s self) -> Option<u64>
pub fn address(&'s self) -> Option<u64>
Returns the machine address of this block, if it has one.
pub fn comment(&'s self) -> Option<&'ctx str>
Sourcepub fn params(
&'s self,
) -> impl Iterator<Item = BlockParamRef<'str, 'ctx, R>> + 's
pub fn params( &'s self, ) -> impl Iterator<Item = BlockParamRef<'str, 'ctx, R>> + 's
Iterates over this block’s parameters in declaration order.
Sourcepub fn num_params(&'s self) -> usize
pub fn num_params(&'s self) -> usize
Returns the number of parameters declared on this block.
Sourcepub fn instructions(&'s self) -> InstructionIter<'str, 'ctx, R> ⓘ
pub fn instructions(&'s self) -> InstructionIter<'str, 'ctx, R> ⓘ
Iterates over the instructions in this block
Sourcepub fn iter(&'s self) -> InstructionIter<'str, 'ctx, R> ⓘ
pub fn iter(&'s self) -> InstructionIter<'str, 'ctx, R> ⓘ
Iterates over the instructions in this block
alias for instructions()
pub fn instruction_ids(&'s self) -> Vec<InstructionId>
Sourcepub fn instruction_count(&'s self) -> usize
pub fn instruction_count(&'s self) -> usize
How many instructions this block holds.
Separate from instruction_ids because that
qualifies every id into a fresh Vec, and a caller that wants only the
count should not allocate for it — the JIT reads this per block
execution.
Sourcepub fn is_terminated(&'s self) -> bool
pub fn is_terminated(&'s self) -> bool
Does this block finish with a terminator instruction?