pub struct Function {
pub value: ValueId,
pub blocks: usize,
pub instructions: Vec<Instruction>,
pub first: ValueId,
pub locals: Vec<Value>,
pub local_types: Vec<TypeId>,
pub attachments: Vec<Attachment>,
pub names: Vec<(ValueId, String)>,
pub block_names: Vec<(usize, String)>,
pub block_use_orders: Vec<(usize, Vec<u64>)>,
}Expand description
A function body.
Fields§
§value: ValueIdThe function’s module value id.
blocks: usizeThe number of basic blocks.
instructions: Vec<Instruction>The instructions of all blocks, in order.
first: ValueIdThe body’s own values (arguments, constants, instruction results) and their types; their ids start at
first, after the module’s values.
locals: Vec<Value>The values of the body.
local_types: Vec<TypeId>The types of Function::locals.
attachments: Vec<Attachment>The metadata attached to the function itself (the attachment records of the body that name no instruction).
names: Vec<(ValueId, String)>The body’s symbol table: the names of its values (arguments and instruction results, by absolute id).
block_names: Vec<(usize, String)>The names of its basic blocks that have one.
block_use_orders: Vec<(usize, Vec<u64>)>The use-list orders of its basic blocks (USELIST_CODE_BB): each block and the position its uses take, in the
order LLVM would otherwise keep them (the most recent first). They are the order of its predecessors.