pub type FunctionMutRef<'str, 'ctx> = BaseRef<&'ctx mut Context<'str>, FunctionId>;Aliased Type§
pub struct FunctionMutRef<'str, 'ctx> {
pub id: FunctionId,
/* private fields */
}Fields§
§id: FunctionIdImplementations§
Source§impl<'str, 'ctx> FunctionMutRef<'str, 'ctx>
impl<'str, 'ctx> FunctionMutRef<'str, 'ctx>
pub fn as_ref(&self) -> FunctionRef<'str, '_>
pub fn name(&self) -> &str
pub fn blocks(&self) -> impl Iterator<Item = BlockRef<'str, '_>>
pub fn root(&self) -> Option<BlockRef<'str, '_>>
Sourcepub fn set_root(&mut self, id: BlockId) -> Result<()>
pub fn set_root(&mut self, id: BlockId) -> Result<()>
Sets a block as the root of this function. This will also add the block to the function’s block list if it’s not already present. This will also set the address of the function/block to the address of the root block/function if both addresses are unset. Panics if the function already has an address that doesn’t match the root block’s address.
pub fn make_root(&mut self) -> BlockRef<'str, '_>
pub fn ensure_root(&mut self, id: BlockId) -> Result<()>
pub fn set_external(&mut self, is_external: bool)
Sourcepub fn set_import_ordinal(&mut self, ordinal: Option<u16>)
pub fn set_import_ordinal(&mut self, ordinal: Option<u16>)
Record the ordinal a by-ordinal PE import was brought in at. Set by the
resolve_ordinals pass before it renames the stub, so the by-ordinal
origin survives the rename.
pub fn set_kind(&mut self, kind: FunctionKind)
pub fn set_signature(&mut self, sig: FunctionSignature)
Sourcepub fn set_param_attrs(&mut self, attrs: Vec<ParamAttrs>)
pub fn set_param_attrs(&mut self, attrs: Vec<ParamAttrs>)
Records the inferred per-parameter pointer attributes on this function.
See FunctionSignature::param_attrs.
Sourcepub fn clear_param_attrs(&mut self)
pub fn clear_param_attrs(&mut self)
Drops any inferred per-parameter attributes (e.g. after a signature rewrite changed the parameter list, invalidating the index alignment).
Sourcepub fn set_written_spaces(&mut self, spaces: Option<Vec<SpaceId>>)
pub fn set_written_spaces(&mut self, spaces: Option<Vec<SpaceId>>)
Records the analysis-computed set of non-register spaces this function may
write. This is always a deliberate stamp: Some(spaces) is a bounded
witnessed set, None records stamped unbounded (⊤) — never clears the
stamp back to unstamped. See FunctionSignature::written_spaces and
FunctionRef::written_spaces_state.
Sourcepub fn set_extern_interface(&mut self, iface: ExternInterface)
pub fn set_extern_interface(&mut self, iface: ExternInterface)
Records the C-prototype-derived external call interface on this function.
See FunctionSignature::extern_interface; set by external_sigs,
consumed by argpromote_external.
Sourcepub fn set_argmem(&mut self, argmem: ExternArgmem)
pub fn set_argmem(&mut self, argmem: ExternArgmem)
Records the C-prototype-derived argmem summary on this external. See
FunctionSignature::argmem; set by external_sigs, read by the RAM
effect channel’s external_leaf.
Sourcepub fn set_register_effects(&mut self, register: RegisterChannelState)
pub fn set_register_effects(&mut self, register: RegisterChannelState)
Records this function’s register-channel effect state, preserving the
memory channel (read-modify-write). See FunctionInterface::effects.
Sourcepub fn set_memory_effects(&mut self, memory: MemoryChannelState)
pub fn set_memory_effects(&mut self, memory: MemoryChannelState)
Records this function’s memory-channel effect state, preserving the
register channel (read-modify-write). See FunctionInterface::effects.
Replaces every component of the memory channel. The channel has two
independent writers — the effect solve owns coarse/precise, the RAM
channel’s rewrite owns materialized — so a caller that computes only
one writer’s components must not build a whole state and pass it here:
the other writer’s field would be silently lost. Use
set_memory_solved or
set_memory_interface instead.
Sourcepub fn set_memory_solved(
&mut self,
coarse: WrittenSpacesState,
precise: Option<Footprint>,
)
pub fn set_memory_solved( &mut self, coarse: WrittenSpacesState, precise: Option<Footprint>, )
Records the solved components of the memory channel — the coarse written-space verdict and the precise footprint the same solve derived — leaving the materialized interface untouched.
The effect solve does not compute the interface, so it must not clear it.
Sourcepub fn set_memory_interface(&mut self, materialized: Option<MemoryInterfaceMap>)
pub fn set_memory_interface(&mut self, materialized: Option<MemoryInterfaceMap>)
Records the materialized memory interface, leaving the solved components
untouched. None marks the memory channel as not materialized.
Sourcepub fn set_is_pure(&mut self, value: bool)
pub fn set_is_pure(&mut self, value: bool)
Marks this function as fully functionalized over every side-effect
channel — a deterministic pure function of its params. See
FunctionSignature::is_pure.
Sourcepub fn set_reads_unbounded_stack(&mut self, value: bool)
pub fn set_reads_unbounded_stack(&mut self, value: bool)
Records whether this function performs an unresolved/dynamic stack read.
See FunctionSignature::reads_unbounded_stack.
Sourcepub fn set_frame_escapes_to_unbounded(&mut self, value: bool)
pub fn set_frame_escapes_to_unbounded(&mut self, value: bool)
Records whether this function hands a pointer into its own frame to a
callee that may read it unboundedly. See
FunctionSignature::frame_escapes_to_unbounded.
Sourcepub fn add_instruction_addr(&mut self, addr: u64)
pub fn add_instruction_addr(&mut self, addr: u64)
Records the address of a machine instruction lifted into this function.
Sourcepub fn add_block(&mut self, id: BlockId)
pub fn add_block(&mut self, id: BlockId)
Associates block with function by setting the block’s parent field.
With per-function block arenas, membership is arena ownership: a block
lives in the arena of the function it was born into (id.func), and that
must equal self.id. Ownership is derived from the arena, so this only
ensures the roster lists the block; it no longer moves storage between
functions.