Skip to main content

FunctionMutRef

Type Alias FunctionMutRef 

Source
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: FunctionId

Implementations§

Source§

impl<'str, 'ctx> FunctionMutRef<'str, 'ctx>

Source

pub fn as_ref(&self) -> FunctionRef<'str, '_>

Source

pub fn name(&self) -> &str

Source

pub fn blocks(&self) -> impl Iterator<Item = BlockRef<'str, '_>>

Source

pub fn root(&self) -> Option<BlockRef<'str, '_>>

Source

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.

Source

pub fn make_root(&mut self) -> BlockRef<'str, '_>

Source

pub fn ensure_root(&mut self, id: BlockId) -> Result<()>

Source

pub fn set_external(&mut self, is_external: bool)

Source

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.

Source

pub fn set_kind(&mut self, kind: FunctionKind)

Source

pub fn set_signature(&mut self, sig: FunctionSignature)

Source

pub fn set_param_attrs(&mut self, attrs: Vec<ParamAttrs>)

Records the inferred per-parameter pointer attributes on this function. See FunctionSignature::param_attrs.

Source

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn add_instruction_addr(&mut self, addr: u64)

Records the address of a machine instruction lifted into this function.

Source

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.

Trait Implementations§

Source§

impl Display for FunctionMutRef<'_, '_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Named for FunctionMutRef<'_, '_>

Source§

fn name(&self) -> Option<&str>

Source§

impl<'str, 'ctx> Renameable<'str, 'ctx> for FunctionMutRef<'str, 'ctx>

Source§

fn rename(&mut self, name: Cow<'str, str>) -> Result<()>

Source§

fn with_name(self, name: Cow<'str, str>) -> Result<Self>
where Self: Sized,

Source§

impl<'ctx, 'str> Value<'str, 'ctx> for FunctionMutRef<'str, 'ctx>

Source§

fn id(&self) -> ValueId

The context-unique identifier for this value.
Source§

fn size(&self) -> usize

The size of this value’s output in bytes, or 0 for non-data values (terminators, blocks, functions).
Source§

impl<'s, 'ctx: 's, 'str: 'ctx> WithCtx<'s, 's, 'str> for FunctionMutRef<'str, 'ctx>

Source§

fn ctx(&'s self) -> &'s Context<'str>

Source§

impl<'s, 'ctx: 's, 'str: 'ctx> WithCtxMut<'s, 'str> for FunctionMutRef<'str, 'ctx>

Source§

fn ctx_mut(&'s mut self) -> &'s mut Context<'str>