pub struct FnDecl {
pub addr: Option<u64>,
pub name: String,
pub attrs: Vec<Attribute>,
pub signature: Option<Signature>,
pub locals: Vec<LocalDecl>,
pub body: Vec<Stmt>,
}Expand description
A function declaration.
signature carries typed parameters and return type when known
(e.g. recovered from DWARF). When absent, the function emits as
fn name() { … } and behaves as untyped.
Fields§
§addr: Option<u64>Optional @addr(0x…) directive preceding fn. Required for
functions whose name doesn’t encode the address (i.e. anything
not matching sub_<hex>); the decompiler emits it always for
clarity.
name: String§attrs: Vec<Attribute>#[…] attributes attached to the fn keyword. Carry per-
function profile info (abi, cc, saves, …); module-level
defaults in the @module header can shadow these.
signature: Option<Signature>Typed parameters and return type, when known.
locals: Vec<LocalDecl>Variable / register declarations at the top of the function
body. Stack slots discovered from [ebp±N] accesses get a
Stack decl; registers the function touches get a Register
decl. Purely informational today (the prologue’s pinned bytes
already encode the actual stack allocation); future work can
use the size hints to drive lowering of a re-allocated frame.
body: Vec<Stmt>