pub type BlockMutRef<'str, 'ctx> = BaseRef<&'ctx mut Context<'str>, BlockId>;Aliased Type§
pub struct BlockMutRef<'str, 'ctx> {
pub id: BlockId,
/* private fields */
}Fields§
§id: BlockIdImplementations§
Source§impl<'str, 'ctx> BlockMutRef<'str, 'ctx>
impl<'str, 'ctx> BlockMutRef<'str, 'ctx>
pub fn num_params(&self) -> usize
pub fn instruction_ids(&self) -> Vec<InstructionId>
pub fn instructions(&self) -> impl Iterator<Item = InstructionRef<'str, '_>>
pub fn address(&self) -> Option<u64>
pub fn successors(&self) -> impl Iterator<Item = (EdgeId, BlockId)>
Sourcepub fn with_address(self, addr: u64) -> Self
pub fn with_address(self, addr: u64) -> Self
Builder-style address assignment. Panics if addr is already mapped.
Use set_address for fallible assignment.
Sourcepub fn with_address_indexed(
self,
addresses: &mut AddressIndex,
addr: u64,
) -> Self
pub fn with_address_indexed( self, addresses: &mut AddressIndex, addr: u64, ) -> Self
Indexed construction variant of with_address.
pub fn in_function(self, fun_id: FunctionId) -> Self
pub fn with_id(&mut self, id: BlockId) -> &mut Self
Sourcepub fn reborrow(&mut self) -> BlockMutRef<'str, '_>
pub fn reborrow(&mut self) -> BlockMutRef<'str, '_>
Reborrows this BlockMutRef, shortening the lifetime.
pub fn parent_mut(&mut self) -> Option<FunctionMutRef<'str, '_>>
pub fn as_ref(&self) -> BlockRef<'str, '_>
Sourcepub fn push_param(&mut self, size: usize) -> BlockParamMutRef<'str, '_>
pub fn push_param(&mut self, size: usize) -> BlockParamMutRef<'str, '_>
Declares a new parameter on this block with the given size in bytes.
The parameter is appended to the block’s params list and its parent
is set to this block. It does NOT appear in instructions.
Returns a mutable reference whose ValueId can be used as an operand.
Sourcepub fn push_existing_param(&mut self, id: BlockParamId)
pub fn push_existing_param(&mut self, id: BlockParamId)
Appends an already-created block parameter to the parameters list
Sourcepub fn insert_insn_after(
&mut self,
after_id: InstructionId,
insn_id: InstructionId,
)
pub fn insert_insn_after( &mut self, after_id: InstructionId, insn_id: InstructionId, )
Inserts an instruction after the instruction identified by after_id in this block.
Panics if after_id is not an instruction in this block.
Sourcepub fn retain_insns(&mut self, f: impl FnMut(&InstructionId) -> bool)
pub fn retain_insns(&mut self, f: impl FnMut(&InstructionId) -> bool)
Retains only the instructions for which f returns true, deleting the
removed instructions.
Sourcepub fn extend_insns(&mut self, insns: &[InstructionId])
pub fn extend_insns(&mut self, insns: &[InstructionId])
Appends a slice of instruction ids to this block.
Sourcepub fn set_address(&mut self, addr: u64) -> Result<()>
pub fn set_address(&mut self, addr: u64) -> Result<()>
Associates this block with addr in the context address map.
Names the block after addr if it doesn’t already have a name.
Returns Err if another value is already mapped to addr.
Sourcepub fn set_address_indexed(
&mut self,
addresses: &mut AddressIndex,
addr: u64,
) -> Result<()>
pub fn set_address_indexed( &mut self, addresses: &mut AddressIndex, addr: u64, ) -> Result<()>
Assigns an address through a caller-owned construction index.