Type Alias cranelift_codegen::CompiledCode

source ·
pub type CompiledCode = CompiledCodeBase<Final>;
Expand description

CompiledCode in its final form (i.e. after FunctionParameters have been applied), ready for consumption.

Aliased Type§

struct CompiledCode {
    pub buffer: MachBufferFinalized<Final>,
    pub frame_size: u32,
    pub vcode: Option<String>,
    pub value_labels_ranges: HashMap<ValueLabel, Vec<ValueLocRange>>,
    pub sized_stackslot_offsets: PrimaryMap<StackSlot, u32>,
    pub dynamic_stackslot_offsets: PrimaryMap<DynamicStackSlot, u32>,
    pub bb_starts: Vec<u32>,
    pub bb_edges: Vec<(u32, u32)>,
}

Fields§

§buffer: MachBufferFinalized<Final>

Machine code.

§frame_size: u32

Size of stack frame, in bytes.

§vcode: Option<String>

Disassembly, if requested.

§value_labels_ranges: HashMap<ValueLabel, Vec<ValueLocRange>>

Debug info: value labels to registers/stackslots at code offsets.

§sized_stackslot_offsets: PrimaryMap<StackSlot, u32>

Debug info: stackslots to stack pointer offsets.

§dynamic_stackslot_offsets: PrimaryMap<DynamicStackSlot, u32>

Debug info: stackslots to stack pointer offsets.

§bb_starts: Vec<u32>

Basic-block layout info: block start offsets.

This info is generated only if the machine_code_cfg_info flag is set.

§bb_edges: Vec<(u32, u32)>

Basic-block layout info: block edges. Each edge is (from, to), where from and to are basic-block start offsets of the respective blocks.

This info is generated only if the machine_code_cfg_info flag is set.

Implementations§

source§

impl CompiledCode

source

pub fn get_code_bb_layout(&self) -> (Vec<usize>, Vec<(usize, usize)>)

If available, return information about the code layout in the final machine code: the offsets (in bytes) of each basic-block start, and all basic-block edges.

source

pub fn create_unwind_info( &self, isa: &dyn TargetIsa ) -> CodegenResult<Option<UnwindInfo>>

Creates unwind information for the function.

Returns None if the function has no unwind information.

source

pub fn create_unwind_info_of_kind( &self, isa: &dyn TargetIsa, unwind_info_kind: UnwindInfoKind ) -> CodegenResult<Option<UnwindInfo>>

Creates unwind information for the function using the supplied “kind”. Supports cross-OS (but not cross-arch) generation.

Returns None if the function has no unwind information.