asmjit::FuncNode Class Reference [¶]

Function node represents a function used by BaseCompiler.
A function is composed of the following:
- Function entry, FuncNode acts as a label, so the entry is implicit. To get the entry, simply use FuncNode::label(), which is the same as LabelNode::label().
- Function exit, which is represented by FuncNode::exit_node(). A helper function FuncNode::exit_label() exists and returns an exit label instead of node.
- Function FuncNode::end_node() sentinel. This node marks the end of a function - there should be no code that belongs to the function after this node, but the Compiler doesn't enforce that at the moment.
- Function detail, see FuncNode::detail().
- Function frame, see FuncNode::frame().
- Function arguments mapped to virtual registers, see FuncNode::arg_packs().
In a node list, the function and its body looks like the following:
When a function is added to the instruction stream by BaseCompiler::add_func() it actually inserts 3 nodes (FuncNode, ExitLabel, and FuncEnd) and sets the current cursor to be FuncNode. When BaseCompiler::end_func() is called the cursor is set to FuncEnd. This guarantees that user can use ExitLabel as a marker after additional code or data can be placed, which is a common practice.