pub struct CompiledCode {
pub buffer: MachBufferFinalized,
pub vcode: Option<String>,
pub value_labels_ranges: ValueLabelsRanges,
pub bb_starts: Vec<CodeOffset>,
pub bb_edges: Vec<(CodeOffset, CodeOffset)>,
}Expand description
The result of a MachBackend::compile_function() call. Contains machine
code (as bytes) and a disassembly, if requested.
Fields§
§buffer: MachBufferFinalizedMachine code.
vcode: Option<String>Disassembly, if requested.
value_labels_ranges: ValueLabelsRangesDebug info: value labels to registers/stackslots at code offsets.
bb_starts: Vec<CodeOffset>Basic-block layout info: block start offsets.
This info is generated only if the machine_code_cfg_info
flag is set.
bb_edges: Vec<(CodeOffset, CodeOffset)>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
impl CompiledCode
Sourcepub fn code_info(&self) -> CodeInfo
pub fn code_info(&self) -> CodeInfo
Get a CodeInfo describing section sizes from this compilation result.
Sourcepub fn code_buffer(&self) -> &[u8] ⓘ
pub fn code_buffer(&self) -> &[u8] ⓘ
Returns a reference to the machine code generated for this function compilation.
Sourcepub fn get_code_bb_layout(&self) -> (Vec<usize>, Vec<(usize, usize)>)
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.
Sourcepub fn create_unwind_info(
&self,
isa: &dyn TargetIsa,
) -> CodegenResult<Option<UnwindInfo>>
Available on crate feature unwind only.
pub fn create_unwind_info( &self, isa: &dyn TargetIsa, ) -> CodegenResult<Option<UnwindInfo>>
unwind only.Creates unwind information for the function.
Returns None if the function has no unwind information.
Sourcepub fn create_unwind_info_of_kind(
&self,
isa: &dyn TargetIsa,
unwind_info_kind: UnwindInfoKind,
) -> CodegenResult<Option<UnwindInfo>>
Available on crate feature unwind only.
pub fn create_unwind_info_of_kind( &self, isa: &dyn TargetIsa, unwind_info_kind: UnwindInfoKind, ) -> CodegenResult<Option<UnwindInfo>>
unwind only.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.