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 disassemble(
&self,
params: Option<&FunctionParameters>,
cs: &Capstone,
) -> Result<String, Error>
Available on crate feature disas only.
pub fn disassemble( &self, params: Option<&FunctionParameters>, cs: &Capstone, ) -> Result<String, Error>
disas only.Get the disassembly of the buffer, using the given capstone context.
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.
Trait Implementations§
Source§impl Clone for CompiledCode
impl Clone for CompiledCode
Source§fn clone(&self) -> CompiledCode
fn clone(&self) -> CompiledCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompiledCode
impl Debug for CompiledCode
Source§impl<'de> Deserialize<'de> for CompiledCode
Available on crate feature enable-serde only.
impl<'de> Deserialize<'de> for CompiledCode
enable-serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CompiledCode
impl PartialEq for CompiledCode
Source§impl Serialize for CompiledCode
Available on crate feature enable-serde only.
impl Serialize for CompiledCode
enable-serde only.