pub struct Builder<'str, 'ctx> { /* private fields */ }Expand description
A builder for constructing instructions in a block. This provides a convenient API for creating instructions, and automatically manages temporary values and labels.
Implementations§
Source§impl<'str, 'ctx> Builder<'str, 'ctx>
impl<'str, 'ctx> Builder<'str, 'ctx>
Sourcepub fn make_temp(&mut self, size: usize) -> TempId
pub fn make_temp(&mut self, size: usize) -> TempId
Creates an anonymous body-local temporary memory value.
Sourcepub fn make_named_temp(&mut self, name: Cow<'str, str>, size: usize) -> TempId
pub fn make_named_temp(&mut self, name: Cow<'str, str>, size: usize) -> TempId
Creates a named body-local temporary memory value.
Sourcepub fn make_temp_labeled(&mut self, label: u32, size: usize) -> TempId
pub fn make_temp_labeled(&mut self, label: u32, size: usize) -> TempId
Creates a body-local temporary identified by a SLEIGH local label.
Sourcepub fn new(
body: &'ctx mut FunctionBody<'str>,
shared: &'ctx Shared<'str>,
interfaces: &'ctx Registry<FunctionId, FunctionInterface<'str>>,
block: BlockId,
) -> Self
pub fn new( body: &'ctx mut FunctionBody<'str>, shared: &'ctx Shared<'str>, interfaces: &'ctx Registry<FunctionId, FunctionInterface<'str>>, block: BlockId, ) -> Self
Creates a builder positioned at block.
The block is borrowed mutably for the lifetime 'ctx. New instructions
will be appended to the end of block.
Sourcepub fn new_local(
body: &'ctx mut FunctionBody<'str>,
shared: &'ctx Shared<'str>,
interfaces: &'ctx Registry<FunctionId, FunctionInterface<'str>>,
block: LocalBlockId,
) -> Self
pub fn new_local( body: &'ctx mut FunctionBody<'str>, shared: &'ctx Shared<'str>, interfaces: &'ctx Registry<FunctionId, FunctionInterface<'str>>, block: LocalBlockId, ) -> Self
Creates a builder positioned at a body-local block, without ever
consulting the body’s registry identity. This is the id-less constructor:
it works on a detached (uninstalled) body just as well as an installed
one. is_terminated is read straight from the block’s own arena (its last
instruction’s mnemonic), never through the composite BodyView path.
Sourcepub fn view(&self) -> BodyView<'_, 'str>
pub fn view(&self) -> BodyView<'_, 'str>
A Copy read view over the builder’s backing, for arena reads. The builder
reads through the backing’s static QCodeView.
Sourcepub fn is_terminated(&self) -> bool
pub fn is_terminated(&self) -> bool
Returns true if the current block ends with a terminator instruction.
Sourcepub fn set_address(&mut self, addr: u64)
pub fn set_address(&mut self, addr: u64)
Sets the current address for instructions added by this builder.
Sourcepub fn clear_address(&mut self)
pub fn clear_address(&mut self)
Remove the current address
Sourcepub fn set_insert_point_to_start(&mut self)
pub fn set_insert_point_to_start(&mut self)
Positions the builder at the beginning of the block.
Subsequent push_* calls insert instructions starting at index 0,
advancing by 1 after each push, so they appear in push order as a
contiguous prefix before any pre-existing instructions.
This allows inserting synthetic preamble instructions (e.g. a symbolic stack-pointer initialization) into a block that already contains lifted code, without disturbing the relative order of either the new or the existing instructions.
Sourcepub fn set_insert_point_before(&mut self, before_id: InstructionId)
pub fn set_insert_point_before(&mut self, before_id: InstructionId)
Positions the builder immediately before an existing instruction in the current block.
Subsequent push_* calls insert instructions starting at that position,
advancing by 1 after each push, so they appear in push order immediately
before before_id and after any earlier inserted instructions.
Panics if before_id is not an instruction in the current block.
Sourcepub fn set_insert_point_to_end(&mut self)
pub fn set_insert_point_to_end(&mut self)
Resets the insert point to append mode (the default).
Sourcepub fn get_range(
&mut self,
src: ValueId,
range: Range<usize>,
) -> Option<ValueRef<'str, '_, BodyView<'_, 'str>>>
pub fn get_range( &mut self, src: ValueId, range: Range<usize>, ) -> Option<ValueRef<'str, '_, BodyView<'_, 'str>>>
Gets a sub-value from a given value, specified by a byte range.
Sourcepub fn get_range_local(
&mut self,
src: LocalValueId,
range: Range<usize>,
) -> Option<LocalValueId>
pub fn get_range_local( &mut self, src: LocalValueId, range: Range<usize>, ) -> Option<LocalValueId>
Body-local core of get_range: folds a literal/temp
sub-range in place and emits a Range instruction for varnode/instruction
sources. Operands and result are body-local; no registry identity is used.
Sourcepub fn push_range(
&mut self,
src: ValueId,
start: usize,
size: usize,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_range( &mut self, src: ValueId, start: usize, size: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Pushes a Range instruction extracting size bytes starting at byte
start of src. Unlike get_range, this always emits
a Range instruction (no constant/varnode folding), so the result is a
fresh SSA value — used by the qcode! macro’s src[start:end] form.
Sourcepub fn push_range_local(
&mut self,
src: LocalValueId,
start: usize,
size: usize,
) -> LocalInsnId
pub fn push_range_local( &mut self, src: LocalValueId, start: usize, size: usize, ) -> LocalInsnId
Body-local core of push_range.
Sourcepub fn remove_alias(&mut self, name: &str)
pub fn remove_alias(&mut self, name: &str)
Removes a name from the local namespace, freeing it for reuse.
Sourcepub fn set_alias(&mut self, name: Cow<'str, str>, id: ValueId)
pub fn set_alias(&mut self, name: Cow<'str, str>, id: ValueId)
Sets a name in the local alias map without changing the qcode name hint. The alias map maps sleigh names to values for macro lookups; re-aliasing is allowed.
pub fn switch_to_block(&mut self, block: BlockId)
Sourcepub fn switch_to_block_local(&mut self, block: LocalBlockId)
pub fn switch_to_block_local(&mut self, block: LocalBlockId)
Reposition the builder onto a body-local block (id-less).
Sourcepub fn current_block(&self) -> BlockId
pub fn current_block(&self) -> BlockId
The block the builder is currently appending to.
Sourcepub fn try_get_value(
&self,
name: &str,
) -> Option<ValueRef<'str, '_, BodyView<'_, 'str>>>
pub fn try_get_value( &self, name: &str, ) -> Option<ValueRef<'str, '_, BodyView<'_, 'str>>>
Gets the ID of a value in the current namespace
Sourcepub fn shr(&self) -> &Shared<'str>
pub fn shr(&self) -> &Shared<'str>
The module’s shared IR state (read) — types/literals/spaces/registers.
Sourcepub fn push_mnemonic_with_type(
&mut self,
mnemonic: Mnemonic,
type_id: TypeId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_mnemonic_with_type( &mut self, mnemonic: Mnemonic, type_id: TypeId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Adds an instruction with an explicit result type, for callers that compute
the type themselves. Needed by passes that reference a minted
(not-yet-installed) function from a Map/Scan/Apply: the typed
push_map/push_scan/push_apply read the body function’s return type
through the shared context, where a minted placeholder has no installed
body — so the pass supplies the type it already knows instead.
pub fn set_param_type(&mut self, id: BlockParamId, type_id: TypeId)
pub fn get_or_make_local_label(&mut self, name: Cow<'str, str>) -> BlockId
Sourcepub fn get_or_make_local_temp_space(&mut self, name: &str) -> LocalMemorySpaceId
pub fn get_or_make_local_temp_space(&mut self, name: &str) -> LocalMemorySpaceId
Resolve a canonical textual $tempN token to one body-local temporary
space, creating it on first use. This is a lowering compatibility seam;
analysis and lifter producers append their spaces directly to the body.
Sourcepub fn ensure_local(&mut self, src: ValueId) -> ValueId
pub fn ensure_local(&mut self, src: ValueId) -> ValueId
Ensures an operand is not a memory value. If the operand is a shared varnode or body-local temporary, emits a load and returns its SSA result. Other values are already directly usable.
Sourcepub fn ensure_local_local(&mut self, src: LocalValueId) -> LocalValueId
pub fn ensure_local_local(&mut self, src: LocalValueId) -> LocalValueId
Body-local core of ensure_local: loads a shared
varnode or body-local temporary into an SSA value, giving the load a
related debug name; other operands pass through. Id-free.
Sourcepub fn push_load<const CHECK_LOCAL: bool>(
&mut self,
src: ValueId,
size: usize,
space: impl Into<LocalMemorySpaceId>,
) -> ValueRef<'str, '_, BodyView<'_, 'str>>
pub fn push_load<const CHECK_LOCAL: bool>( &mut self, src: ValueId, size: usize, space: impl Into<LocalMemorySpaceId>, ) -> ValueRef<'str, '_, BodyView<'_, 'str>>
Loads a value from memory, given a pointer value. Optionally specify the address space and size of the load.
If the load space is the special CONST space, the pointer is treated as an immediate value rather than an address.
§Panics
Panics if space is SPACE_CONST and src is not a Literal value.
Sourcepub fn push_load_local<const CHECK_LOCAL: bool>(
&mut self,
src: LocalValueId,
size: usize,
space: impl Into<LocalMemorySpaceId>,
) -> LocalValueId
pub fn push_load_local<const CHECK_LOCAL: bool>( &mut self, src: LocalValueId, size: usize, space: impl Into<LocalMemorySpaceId>, ) -> LocalValueId
Body-local core of push_load. Operand and result are
body-local; consults no registry identity.
Sourcepub fn push_bool_not(
&mut self,
src: ValueId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_bool_not( &mut self, src: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Logical NOT of a bool value, canonically src == false.
Sourcepub fn push_bool_not_local(&mut self, src: LocalValueId) -> LocalInsnId
pub fn push_bool_not_local(&mut self, src: LocalValueId) -> LocalInsnId
Body-local sibling of push_bool_not.
Sourcepub fn push_bit_negate(
&mut self,
src: ValueId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_bit_negate( &mut self, src: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Creates a bitwise NOT operation on the given value.
Sourcepub fn push_bit_negate_local(&mut self, src: LocalValueId) -> LocalInsnId
pub fn push_bit_negate_local(&mut self, src: LocalValueId) -> LocalInsnId
Body-local sibling.
Sourcepub fn push_neg(
&mut self,
src: ValueId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_neg( &mut self, src: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Creates a negation operation on the given value.
Sourcepub fn push_neg_local(&mut self, src: LocalValueId) -> LocalInsnId
pub fn push_neg_local(&mut self, src: LocalValueId) -> LocalInsnId
Body-local sibling.
Sourcepub fn push_fneg(
&mut self,
src: ValueId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_fneg( &mut self, src: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Creates a float negation operation on the given value.
Sourcepub fn push_fneg_local(&mut self, src: LocalValueId) -> LocalInsnId
pub fn push_fneg_local(&mut self, src: LocalValueId) -> LocalInsnId
Body-local sibling.
pub fn push_mul( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_mul_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_mul_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_div( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_div_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_div_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_sdiv( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_sdiv_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_sdiv_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_mod( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_mod_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_mod_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_smod( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_smod_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_smod_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_add( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_add_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_add_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_sub( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_sub_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_sub_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_fdiv( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_fdiv_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_fdiv_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_fmul( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_fmul_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_fmul_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_fadd( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_fadd_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_fadd_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_fsub( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_fsub_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_fsub_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_shl( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_shl_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_shl_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_shr( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_shr_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_shr_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_sshr( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_sshr_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_sshr_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_slt( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_slt_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_sgt( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_sgt_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_sle( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_sle_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_sge( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_sge_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_lt( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_lt_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_gt( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_gt_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_le( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_le_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_ge( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_ge_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_flt( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_flt_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_fgt( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_fgt_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_fle( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_fle_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_fge( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_fge_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
pub fn push_eq( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_eq_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_eq_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_ne( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_ne_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_ne_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_feq( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_feq_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_feq_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_fne( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_fne_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_fne_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
Sourcepub fn push_bool_xor(
&mut self,
lhs: ValueId,
rhs: ValueId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_bool_xor( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Logical XOR of two bool operands — a bitwise Xor over bool, which
yields bool (exact on the {0,1} domain).
Sourcepub fn push_bool_xor_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_bool_xor_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling of push_bool_xor.
Sourcepub fn push_bool_and(
&mut self,
lhs: ValueId,
rhs: ValueId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_bool_and( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Logical AND of two bool operands (bitwise And over bool).
Sourcepub fn push_bool_and_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_bool_and_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling of push_bool_and.
Sourcepub fn push_bool_or(
&mut self,
lhs: ValueId,
rhs: ValueId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_bool_or( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Logical OR of two bool operands (bitwise Or over bool).
Sourcepub fn push_bool_or_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_bool_or_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling of push_bool_or.
pub fn push_bit_xor( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_bit_xor_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_bit_xor_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_bit_or( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_bit_or_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_bit_or_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_bit_and( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_bit_and_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_bit_and_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling.
pub fn push_is_nan( &mut self, src: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_is_nan_local(&mut self, src: LocalValueId) -> LocalInsnId
pub fn push_is_nan_local(&mut self, src: LocalValueId) -> LocalInsnId
Body-local sibling of push_is_nan.
pub fn push_abs( &mut self, src: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_abs_local(&mut self, src: LocalValueId) -> LocalInsnId
pub fn push_abs_local(&mut self, src: LocalValueId) -> LocalInsnId
Body-local sibling.
pub fn push_sqrt( &mut self, src: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_sqrt_local(&mut self, src: LocalValueId) -> LocalInsnId
pub fn push_sqrt_local(&mut self, src: LocalValueId) -> LocalInsnId
Body-local sibling.
pub fn push_floor( &mut self, src: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_floor_local(&mut self, src: LocalValueId) -> LocalInsnId
pub fn push_floor_local(&mut self, src: LocalValueId) -> LocalInsnId
Body-local sibling.
pub fn push_ceil( &mut self, src: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_ceil_local(&mut self, src: LocalValueId) -> LocalInsnId
pub fn push_ceil_local(&mut self, src: LocalValueId) -> LocalInsnId
Body-local sibling.
pub fn push_round( &mut self, src: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_round_local(&mut self, src: LocalValueId) -> LocalInsnId
pub fn push_round_local(&mut self, src: LocalValueId) -> LocalInsnId
Body-local sibling.
pub fn push_int_to_float( &mut self, src: ValueId, size: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_int_to_float_local(
&mut self,
src: LocalValueId,
size: usize,
) -> LocalInsnId
pub fn push_int_to_float_local( &mut self, src: LocalValueId, size: usize, ) -> LocalInsnId
Body-local sibling.
pub fn push_float_to_float( &mut self, src: ValueId, size: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_float_to_float_local(
&mut self,
src: LocalValueId,
size: usize,
) -> LocalInsnId
pub fn push_float_to_float_local( &mut self, src: LocalValueId, size: usize, ) -> LocalInsnId
Body-local sibling.
pub fn push_trunc( &mut self, src: ValueId, size: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_trunc_local(
&mut self,
src: LocalValueId,
size: usize,
) -> LocalInsnId
pub fn push_trunc_local( &mut self, src: LocalValueId, size: usize, ) -> LocalInsnId
Body-local sibling.
pub fn push_zext( &mut self, src: ValueId, size: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_zext_local(&mut self, src: LocalValueId, size: usize) -> LocalInsnId
pub fn push_zext_local(&mut self, src: LocalValueId, size: usize) -> LocalInsnId
Body-local sibling.
pub fn push_sext( &mut self, src: ValueId, size: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_sext_local(&mut self, src: LocalValueId, size: usize) -> LocalInsnId
pub fn push_sext_local(&mut self, src: LocalValueId, size: usize) -> LocalInsnId
Body-local sibling.
Sourcepub fn push_tuple(
&mut self,
fields: Vec<ValueId>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_tuple( &mut self, fields: Vec<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Builds an aggregate value from fields using default field names
(field1, field2, …). The result type is the
Aggregate of the named fields’
types.
Sourcepub fn push_tuple_local(&mut self, fields: Vec<LocalValueId>) -> LocalInsnId
pub fn push_tuple_local(&mut self, fields: Vec<LocalValueId>) -> LocalInsnId
Body-local sibling of push_tuple.
Sourcepub fn push_named_tuple(
&mut self,
fields: Vec<(String, ValueId)>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_named_tuple( &mut self, fields: Vec<(String, ValueId)>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Builds an aggregate value from ordered named fields.
Sourcepub fn push_named_tuple_local(
&mut self,
fields: Vec<(String, LocalValueId)>,
) -> LocalInsnId
pub fn push_named_tuple_local( &mut self, fields: Vec<(String, LocalValueId)>, ) -> LocalInsnId
Body-local sibling of push_named_tuple.
Sourcepub fn push_named_tuple_with_type(
&mut self,
fields: Vec<(String, ValueId)>,
ty: TypeId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_named_tuple_with_type( &mut self, fields: Vec<(String, ValueId)>, ty: TypeId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Build a named tuple using an explicitly selected aggregate-like type.
Used for nominal function-return records whose identity must not be
structurally interned by push_named_tuple_local.
Sourcepub fn push_named_tuple_local_with_type(
&mut self,
fields: Vec<(String, LocalValueId)>,
ty: TypeId,
) -> LocalInsnId
pub fn push_named_tuple_local_with_type( &mut self, fields: Vec<(String, LocalValueId)>, ty: TypeId, ) -> LocalInsnId
Body-local sibling of push_named_tuple_with_type.
Sourcepub fn push_extract(
&mut self,
agg: ValueId,
index: usize,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_extract( &mut self, agg: ValueId, index: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Projects field index out of the aggregate value agg. The result type
is that field’s type. Panics if agg is not an aggregate with that field.
Sourcepub fn push_extract_local(
&mut self,
agg: LocalValueId,
index: usize,
) -> LocalInsnId
pub fn push_extract_local( &mut self, agg: LocalValueId, index: usize, ) -> LocalInsnId
Body-local sibling of push_extract.
Sourcepub fn push_map(
&mut self,
body: impl Into<Callee>,
src: ValueId,
captures: Vec<ValueId>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_map( &mut self, body: impl Into<Callee>, src: ValueId, captures: Vec<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Builds a total element-wise map out[i] = body(src[i], captures…) over the
array value src. The body is unary in the element (index-aware bodies
take an enumerate tuple as that element);
body is a function symbol, not an operand. Soundness of the body (pure,
element-local) is the recognizer’s obligation; the builder only wires the
value graph.
The result is [U; N] where N is src’s element count and U is the
body’s return type — which need not equal the input element type (e.g. a
map over enumerate(arr) consumes tuples but returns bare elements). When
the body is a bare symbol with no return (or src is not an array), the
result falls back to src’s type.
Sourcepub fn push_map_local(
&mut self,
body: impl Into<Callee>,
src: LocalValueId,
captures: Vec<LocalValueId>,
) -> LocalInsnId
pub fn push_map_local( &mut self, body: impl Into<Callee>, src: LocalValueId, captures: Vec<LocalValueId>, ) -> LocalInsnId
Body-local sibling of push_map.
Sourcepub fn push_map_typed(
&mut self,
body: impl Into<Callee>,
src: ValueId,
captures: Vec<ValueId>,
result_type: TypeId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_map_typed( &mut self, body: impl Into<Callee>, src: ValueId, captures: Vec<ValueId>, result_type: TypeId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Builds a map with an explicitly prepared result type. Use this when the body is foreign to this Builder and its body-derived return type is not part of the published function interface.
Sourcepub fn push_map_typed_local(
&mut self,
body: impl Into<Callee>,
src: LocalValueId,
captures: Vec<LocalValueId>,
result_type: TypeId,
) -> LocalInsnId
pub fn push_map_typed_local( &mut self, body: impl Into<Callee>, src: LocalValueId, captures: Vec<LocalValueId>, result_type: TypeId, ) -> LocalInsnId
Body-local sibling of push_map_typed.
Sourcepub fn push_scan(
&mut self,
body: impl Into<Callee>,
init: ValueId,
src: ValueId,
captures: Vec<ValueId>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_scan( &mut self, body: impl Into<Callee>, init: ValueId, src: ValueId, captures: Vec<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Builds a total left-scan out[i] = body(acc_i, src[i], captures…) with
acc_0 = init over the array value src (see Scan). The body is
binary in (accumulator, element) — index-aware bodies take an
enumerate tuple as the element; body
is a function symbol, not an operand. Soundness of the body (pure, with the
accumulator threaded only through the scan) is the recognizer’s obligation.
The result is [U; N] where N is src’s element count and U is the
body’s return type (also the accumulator type). When the body is a bare
symbol with no return (or src is not an array), the result falls back to
src’s type.
Sourcepub fn push_scan_local(
&mut self,
body: impl Into<Callee>,
init: LocalValueId,
src: LocalValueId,
captures: Vec<LocalValueId>,
) -> LocalInsnId
pub fn push_scan_local( &mut self, body: impl Into<Callee>, init: LocalValueId, src: LocalValueId, captures: Vec<LocalValueId>, ) -> LocalInsnId
Body-local sibling of push_scan.
Sourcepub fn push_scan_typed(
&mut self,
body: impl Into<Callee>,
init: ValueId,
src: ValueId,
captures: Vec<ValueId>,
result_type: TypeId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_scan_typed( &mut self, body: impl Into<Callee>, init: ValueId, src: ValueId, captures: Vec<ValueId>, result_type: TypeId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Builds a scan with an explicitly prepared result type. This is the
foreign-body counterpart to push_map_typed.
Sourcepub fn push_scan_typed_local(
&mut self,
body: impl Into<Callee>,
init: LocalValueId,
src: LocalValueId,
captures: Vec<LocalValueId>,
result_type: TypeId,
) -> LocalInsnId
pub fn push_scan_typed_local( &mut self, body: impl Into<Callee>, init: LocalValueId, src: LocalValueId, captures: Vec<LocalValueId>, result_type: TypeId, ) -> LocalInsnId
Body-local sibling of push_scan_typed.
Sourcepub fn push_apply(
&mut self,
target: impl Into<Callee>,
args: Vec<ValueId>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_apply( &mut self, target: impl Into<Callee>, args: Vec<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Builds a value-level application of a pure lambda function. Unlike
push_call, this is an ordinary SSA instruction and
does not terminate the current block.
Sourcepub fn push_apply_local(
&mut self,
target: impl Into<Callee>,
args: Vec<LocalValueId>,
) -> LocalInsnId
pub fn push_apply_local( &mut self, target: impl Into<Callee>, args: Vec<LocalValueId>, ) -> LocalInsnId
Body-local sibling of push_apply.
Sourcepub fn push_gep(
&mut self,
base: ValueId,
offset: usize,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_gep( &mut self, base: ValueId, offset: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Computes the address of the field at byte offset of the struct that
base points at: gep(base, offset). base must have a
StructPointer type whose
pointee has a field at exactly offset. The result type is a pointer
(same width as base) to that field’s type. Panics otherwise.
Sourcepub fn push_gep_local(
&mut self,
base: LocalValueId,
offset: usize,
) -> LocalInsnId
pub fn push_gep_local( &mut self, base: LocalValueId, offset: usize, ) -> LocalInsnId
Body-local sibling of push_gep.
Sourcepub fn push_gep_field(
&mut self,
base: ValueId,
name: &str,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_gep_field( &mut self, base: ValueId, name: &str, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Like push_gep but selects the field by name,
resolving it to a byte offset via the pointee struct of base. Panics if
base is not a struct pointer or has no field of that name.
Sourcepub fn push_gep_field_local(
&mut self,
base: LocalValueId,
name: &str,
) -> LocalInsnId
pub fn push_gep_field_local( &mut self, base: LocalValueId, name: &str, ) -> LocalInsnId
Body-local sibling of push_gep_field.
pub fn push_popcount( &mut self, src: ValueId, size: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_popcount_local(
&mut self,
src: LocalValueId,
size: usize,
) -> LocalInsnId
pub fn push_popcount_local( &mut self, src: LocalValueId, size: usize, ) -> LocalInsnId
Body-local sibling of push_popcount.
pub fn push_lzcount( &mut self, src: ValueId, size: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_lzcount_local(
&mut self,
src: LocalValueId,
size: usize,
) -> LocalInsnId
pub fn push_lzcount_local( &mut self, src: LocalValueId, size: usize, ) -> LocalInsnId
Body-local sibling of push_lzcount.
pub fn push_carry( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_carry_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_carry_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling of push_carry.
pub fn push_scarry( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_scarry_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_scarry_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling of push_scarry.
pub fn push_sborrow( &mut self, lhs: ValueId, rhs: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_sborrow_local(
&mut self,
lhs: LocalValueId,
rhs: LocalValueId,
) -> LocalInsnId
pub fn push_sborrow_local( &mut self, lhs: LocalValueId, rhs: LocalValueId, ) -> LocalInsnId
Body-local sibling of push_sborrow.
pub fn push_pcode_op( &mut self, id: PCodeOpId, args: Vec<ValueId>, dst: Option<ValueId>, size: usize, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_pcode_op_local(
&mut self,
id: PCodeOpId,
args: Vec<LocalValueId>,
dst: Option<LocalValueId>,
size: usize,
) -> LocalInsnId
pub fn push_pcode_op_local( &mut self, id: PCodeOpId, args: Vec<LocalValueId>, dst: Option<LocalValueId>, size: usize, ) -> LocalInsnId
Body-local sibling of push_pcode_op.
Sourcepub fn push_intrinsic(
&mut self,
id: IntrinsicId,
args: Vec<ValueId>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_intrinsic( &mut self, id: IntrinsicId, args: Vec<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Creates a pure intrinsic instruction (e.g. rol, ror, enumerate).
Validates the operand count against the intrinsic’s declared arity and
types the node via the intrinsic’s
result_type
rule, so the result carries its full type (not just a width) — an array
or aggregate result is projectable. Panics on an arity mismatch.
Sourcepub fn push_intrinsic_local(
&mut self,
id: IntrinsicId,
args: Vec<LocalValueId>,
) -> LocalInsnId
pub fn push_intrinsic_local( &mut self, id: IntrinsicId, args: Vec<LocalValueId>, ) -> LocalInsnId
Body-local sibling of push_intrinsic.
Sourcepub fn push_copy(
&mut self,
src: ValueId,
dst: impl Into<ValueId>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_copy( &mut self, src: ValueId, dst: impl Into<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Creates a copy instruction from src to dst.
Note that dst must already exist as a Value in the current context, and this will not create a new temporary value.
If dst is a varnode, we aren’t allowed to write to it, this is a store operation
If src is a varnode, we need to read from it first, then write to dst
For values wider than 64 bits (e.g. XMM/YMM/ZMM registers), emits one store per 64-bit lane.
Sourcepub fn push_copy_local(
&mut self,
src: LocalValueId,
dst: LocalValueId,
) -> LocalInsnId
pub fn push_copy_local( &mut self, src: LocalValueId, dst: LocalValueId, ) -> LocalInsnId
Body-local sibling of push_copy.
pub fn push_store( &mut self, src: ValueId, ptr: ValueId, space: impl Into<LocalMemorySpaceId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_store_local(
&mut self,
src: LocalValueId,
ptr: LocalValueId,
space: impl Into<LocalMemorySpaceId>,
) -> LocalInsnId
pub fn push_store_local( &mut self, src: LocalValueId, ptr: LocalValueId, space: impl Into<LocalMemorySpaceId>, ) -> LocalInsnId
Body-local sibling of push_store.
Sourcepub fn push_param(&mut self, size: usize) -> BlockParamId
pub fn push_param(&mut self, size: usize) -> BlockParamId
Declares a new parameter on the current block.
Sourcepub fn push_param_local(&mut self, size: usize) -> LocalParamId
pub fn push_param_local(&mut self, size: usize) -> LocalParamId
Body-local sibling of push_param.
Sourcepub fn finalize(self, target: BlockId)
pub fn finalize(self, target: BlockId)
Terminates the current block with a branch to an already-resolved local target. Module/address discovery must happen before the Builder borrow.
Sourcepub fn finalize_local(&mut self, target: LocalBlockId)
pub fn finalize_local(&mut self, target: LocalBlockId)
Body-local sibling of finalize.
Sourcepub fn push_branch(
&mut self,
target: BlockId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_branch( &mut self, target: BlockId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Terminates this block with an unconditional jump to the given target block. The builder is now safe to drop without panicking, and the block is properly terminated.
Sourcepub fn push_branch_local(&mut self, target: LocalBlockId) -> LocalInsnId
pub fn push_branch_local(&mut self, target: LocalBlockId) -> LocalInsnId
Body-local sibling of push_branch.
Sourcepub fn push_branch_with_args(
&mut self,
target: BlockId,
args: Vec<ValueId>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_branch_with_args( &mut self, target: BlockId, args: Vec<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Unconditional branch passing args to the target block’s parameters.
Sourcepub fn push_branch_with_args_local(
&mut self,
target: LocalBlockId,
args: Vec<LocalValueId>,
) -> LocalInsnId
pub fn push_branch_with_args_local( &mut self, target: LocalBlockId, args: Vec<LocalValueId>, ) -> LocalInsnId
Body-local sibling of push_branch_with_args.
pub fn push_cbranch( &mut self, condition: ValueId, target: BlockId, fallthrough: BlockId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_cbranch_local(
&mut self,
condition: LocalValueId,
target: LocalBlockId,
fallthrough: LocalBlockId,
) -> LocalInsnId
pub fn push_cbranch_local( &mut self, condition: LocalValueId, target: LocalBlockId, fallthrough: LocalBlockId, ) -> LocalInsnId
Body-local sibling of push_cbranch.
Sourcepub fn push_cbranch_with_args(
&mut self,
condition: ValueId,
target: BlockId,
target_args: Vec<ValueId>,
fallthrough: BlockId,
fallthrough_args: Vec<ValueId>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_cbranch_with_args( &mut self, condition: ValueId, target: BlockId, target_args: Vec<ValueId>, fallthrough: BlockId, fallthrough_args: Vec<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Conditional branch with per-target arguments.
Sourcepub fn push_cbranch_with_args_local(
&mut self,
condition: LocalValueId,
target: LocalBlockId,
target_args: Vec<LocalValueId>,
fallthrough: LocalBlockId,
fallthrough_args: Vec<LocalValueId>,
) -> LocalInsnId
pub fn push_cbranch_with_args_local( &mut self, condition: LocalValueId, target: LocalBlockId, target_args: Vec<LocalValueId>, fallthrough: LocalBlockId, fallthrough_args: Vec<LocalValueId>, ) -> LocalInsnId
Body-local sibling of
push_cbranch_with_args.
Sourcepub fn push_switch(
&mut self,
scrutinee: ValueId,
cases: Vec<(u64, BlockId, Vec<ValueId>)>,
default: Option<(BlockId, Vec<ValueId>)>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_switch( &mut self, scrutinee: ValueId, cases: Vec<(u64, BlockId, Vec<ValueId>)>, default: Option<(BlockId, Vec<ValueId>)>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Multi-way dispatch on scrutinee. Wires a CFG edge to every arm and to
the default, exactly as the conditional branch wires its two.
Sourcepub fn push_switch_local(
&mut self,
scrutinee: LocalValueId,
cases: Vec<(u64, LocalBlockId, Vec<LocalValueId>)>,
default: Option<(LocalBlockId, Vec<LocalValueId>)>,
) -> LocalInsnId
pub fn push_switch_local( &mut self, scrutinee: LocalValueId, cases: Vec<(u64, LocalBlockId, Vec<LocalValueId>)>, default: Option<(LocalBlockId, Vec<LocalValueId>)>, ) -> LocalInsnId
Body-local sibling of push_switch.
pub fn push_branchind( &mut self, ptr: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_branchind_local(&mut self, ptr: LocalValueId) -> LocalInsnId
pub fn push_branchind_local(&mut self, ptr: LocalValueId) -> LocalInsnId
Body-local sibling of push_branchind.
pub fn push_call( &mut self, target: impl Into<Callee>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_call_with_args( &mut self, target: impl Into<Callee>, args: Vec<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_call_local(&mut self, target: impl Into<Callee>) -> LocalInsnId
pub fn push_call_local(&mut self, target: impl Into<Callee>) -> LocalInsnId
Body-local sibling of push_call.
Sourcepub fn push_call_with_args_local(
&mut self,
target: impl Into<Callee>,
args: Vec<LocalValueId>,
) -> LocalInsnId
pub fn push_call_with_args_local( &mut self, target: impl Into<Callee>, args: Vec<LocalValueId>, ) -> LocalInsnId
Body-local sibling of push_call_with_args.
Sourcepub fn push_tail_call(
&mut self,
target: impl Into<Callee>,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_tail_call( &mut self, target: impl Into<Callee>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Tail call to another function’s entry — a function-level terminator with
no intra-function CFG successor (see TailCall).
Unlike push_branch, this wires no CFG edge: control
leaves the function.
pub fn push_tail_call_with_args( &mut self, target: impl Into<Callee>, args: Vec<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_tail_call_local(&mut self, target: impl Into<Callee>) -> LocalInsnId
pub fn push_tail_call_local(&mut self, target: impl Into<Callee>) -> LocalInsnId
Body-local sibling of push_tail_call.
Sourcepub fn push_tail_call_with_args_local(
&mut self,
target: impl Into<Callee>,
args: Vec<LocalValueId>,
) -> LocalInsnId
pub fn push_tail_call_with_args_local( &mut self, target: impl Into<Callee>, args: Vec<LocalValueId>, ) -> LocalInsnId
Body-local sibling of
push_tail_call_with_args.
pub fn push_call_ind( &mut self, ptr: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_call_ind_with_args( &mut self, ptr: ValueId, args: Vec<ValueId>, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_call_ind_local(&mut self, ptr: LocalValueId) -> LocalInsnId
pub fn push_call_ind_local(&mut self, ptr: LocalValueId) -> LocalInsnId
Body-local sibling of push_call_ind.
Sourcepub fn push_call_ind_with_args_local(
&mut self,
ptr: LocalValueId,
args: Vec<LocalValueId>,
) -> LocalInsnId
pub fn push_call_ind_with_args_local( &mut self, ptr: LocalValueId, args: Vec<LocalValueId>, ) -> LocalInsnId
Body-local sibling of
push_call_ind_with_args.
pub fn push_return( &mut self, ptr: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_return_local(&mut self, ptr: LocalValueId) -> LocalInsnId
pub fn push_return_local(&mut self, ptr: LocalValueId) -> LocalInsnId
Body-local sibling of push_return.
pub fn push_return_with_value( &mut self, value: ValueId, ptr: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_return_with_value_local(
&mut self,
value: LocalValueId,
ptr: LocalValueId,
) -> LocalInsnId
pub fn push_return_with_value_local( &mut self, value: LocalValueId, ptr: LocalValueId, ) -> LocalInsnId
Body-local sibling of
push_return_with_value.
pub fn push_return_value( &mut self, value: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Sourcepub fn push_bad_insn(&mut self) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_bad_insn(&mut self) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Terminate the current block with BadInsn: bytes that did not decode to
a valid instruction. No successors, no operands.
Sourcepub fn push_bad_insn_local(&mut self) -> LocalInsnId
pub fn push_bad_insn_local(&mut self) -> LocalInsnId
Body-local sibling of push_bad_insn.
Sourcepub fn push_return_value_local(&mut self, value: LocalValueId) -> LocalInsnId
pub fn push_return_value_local(&mut self, value: LocalValueId) -> LocalInsnId
Body-local sibling of push_return_value.
Sourcepub fn push_assert(
&mut self,
condition: ValueId,
) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
pub fn push_assert( &mut self, condition: ValueId, ) -> InstructionRef<'str, '_, BodyView<'_, 'str>>
Asserts that a condition holds at this point in execution
Sourcepub fn push_assert_local(&mut self, condition: LocalValueId) -> LocalInsnId
pub fn push_assert_local(&mut self, condition: LocalValueId) -> LocalInsnId
Body-local sibling of push_assert.