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: booltrue 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: booltrue 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: booltrue 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
impl Clone for FunctionSignature
Source§fn clone(&self) -> FunctionSignature
fn clone(&self) -> FunctionSignature
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more