Skip to main content

FunctionSignature

Struct FunctionSignature 

Source
pub struct FunctionSignature {
    pub reads_unbounded_stack: bool,
    pub frame_escapes_to_unbounded: bool,
    pub is_pure: bool,
    pub param_attrs: Option<Vec<ParamAttrs>>,
    pub extern_interface: Option<ExternInterface>,
    pub argmem: Option<ExternArgmem>,
}
Expand description

Optional ABI description attached to a function. All fields are Option — only provided fields affect analysis.

Fields§

§reads_unbounded_stack: bool

true when this function performs an unresolved/dynamic memory access, or forwards a stack-typed pointer into a callee that does. A caller that hands a pointer into its own frame to such a function cannot bound which of its stack slots the callee reads, so it must keep its whole frame in memory (no stack promotion). See the stack-escape handling in mem2reg.

§frame_escapes_to_unbounded: bool

true when this function passes a pointer into its own stack frame to a callee that may read it unboundedly (a callee with reads_unbounded_stack, an external, or an indirect call). Such a callee may clobber any of this function’s stack slots, so its frame must stay in memory — mem2reg disables all stack promotion for it. Computed at bind time (while StackAddress types are still present) and seeded across checkpoint+replay rounds.

§is_pure: bool

true once this function’s returned values are a deterministic function of its by-value params, with no value flowing in from outside the SSA graph: no loads (an untracked memory read), no calls, no architecture p-code ops, and no raw register/global reads. Stores are permitted — they produce no value, so they cannot feed a returned field. Strictly stronger than a materialized register interface (is_reg_materialized), which only asserts the register channel is functionalized. Pure-function emulation in constant propagation gates on this (see PURE_EMULATION_DESIGN.md): such a callee may be emulated to harvest constant return-tuple fields, with the call left in place. Asserted by argpromote’s mark_pure; checked by a verify/ rule.

§param_attrs: Option<Vec<ParamAttrs>>

Per-parameter pointer attributes (readonly / nocapture), indexed like the positional call arguments (Call.args) — which for a functionalized (pure_reg) callee align with its root block params, and for an external align with the materialized register interface.

None means “not analyzed” (fully conservative — every pointer arg escapes and is written through). A present vector may still be shorter than the argument list; a missing entry is also treated conservatively. Set by the extern C-prototype path (readonly only) and the bottom-up param_attrs inference pass. Dropped (and re-inferred) when argpromote/dead_signature rewrites the parameter list.

§extern_interface: Option<ExternInterface>

C-prototype-derived call interface for an external callee: the ordered argument slots (register or stack) and variadic flag, planned once by external_sigs. argpromote_external reads this to rewrite call sites without re-consulting cabi or the binary. None for non-externals and externals with no known prototype. Serde-defaulted, so older .harbinger snapshots load with it absent.

§argmem: Option<ExternArgmem>

C-prototype-derived argmem summary for a prototyped external callee: the ordered per-input pointer kinds and variadic flag, planned once by external_sigs. The RAM effect channel’s external_leaf reads this to bound the external’s memory footprint through the pointers we pass it, instead of treating every external as unbounded (⊤). None for non-externals and externals with no known prototype. Serde-defaulted, so older .harbinger snapshots load with it absent.

Trait Implementations§

Source§

impl Clone for FunctionSignature

Source§

fn clone(&self) -> FunctionSignature

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for FunctionSignature

Source§

fn default() -> FunctionSignature

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FunctionSignature

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for FunctionSignature

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.