pub trait TargetIsa: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn triple(&self) -> &Triple;
    fn flags(&self) -> &Flags;
    fn isa_flags(&self) -> Vec<Value>;
    fn compile_function(
        &self,
        sig: &FuncType,
        body: &FunctionBody<'_>,
        env: &dyn FuncEnv,
        validator: FuncValidator<ValidatorResources>
    ) -> Result<MachBufferFinalized<Final>>;
    fn text_section_builder(
        &self,
        num_labeled_funcs: usize
    ) -> Box<dyn TextSectionBuilder>;
    fn function_alignment(&self) -> u32;

    // Provided methods
    fn is_branch_protection_enabled(&self) -> bool { ... }
    fn call_conv(&self) -> CallConv { ... }
    fn endianness(&self) -> Endianness { ... }
    fn create_systemv_cie(&self) -> Option<CommonInformationEntry> { ... }
}
Expand description

A trait representing commonalities between the supported instruction set architectures.

Required Methods§

source

fn name(&self) -> &'static str

Get the name of the ISA.

source

fn triple(&self) -> &Triple

Get the target triple of the ISA.

source

fn flags(&self) -> &Flags

Get the ISA-independent flags that were used to make this trait object.

source

fn isa_flags(&self) -> Vec<Value>

Get the ISA-dependent flag values that were used to make this trait object.

source

fn compile_function( &self, sig: &FuncType, body: &FunctionBody<'_>, env: &dyn FuncEnv, validator: FuncValidator<ValidatorResources> ) -> Result<MachBufferFinalized<Final>>

source

fn text_section_builder( &self, num_labeled_funcs: usize ) -> Box<dyn TextSectionBuilder>

See cranelift_codegen::isa::TargetIsa::text_section_builder.

source

fn function_alignment(&self) -> u32

See cranelift_codegen::isa::TargetIsa::function_alignment.

Provided Methods§

source

fn is_branch_protection_enabled(&self) -> bool

Get a flag indicating whether branch protection is enabled.

source

fn call_conv(&self) -> CallConv

Get the default calling convention of the underlying target triple.

source

fn endianness(&self) -> Endianness

Get the endianess of the underlying target triple.

source

fn create_systemv_cie(&self) -> Option<CommonInformationEntry>

See cranelift_codegen::isa::TargetIsa::create_systemv_cie.

Trait Implementations§

source§

impl Debug for &dyn TargetIsa

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Implementors§