Struct golem_wasm_ast::core::Func
source · pub struct Func<Expr: 'static> {
pub type_idx: TypeIdx,
/* private fields */
}
Expand description
The funcs component of a module defines a vector of functions with the following structure.
Functions are referenced through function indices, starting with the smallest index not referencing a function import.
typ
is the type of a function declares its signature by reference to a type defined in the module. The parameters of the
function are referenced through 0-based local indices in the function’s body; they are mutable.
The locals
declare a vector of mutable local variables and their types. These variables are referenced through
local indices in the function’s body. The index of the first local is the smallest index not referencing a
parameter.
The body
is an instruction sequence that upon termination must produce a stack matching the function type’s result
type.
/
Fields§
§type_idx: TypeIdx