pub trait TargetIsa: Display + Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn triple(&self) -> &Triple;
    fn flags(&self) -> &Flags;
    fn isa_flags(&self) -> Vec<Value>;
    fn dynamic_vector_bytes(&self, dynamic_ty: Type) -> u32;
    fn compile_function(
        &self,
        func: &Function,
        want_disasm: bool
    ) -> CodegenResult<CompiledCodeBase<Stencil>>;
    fn unsigned_add_overflow_condition(&self) -> IntCC;
    fn emit_unwind_info(
        &self,
        result: &CompiledCode,
        kind: UnwindInfoKind
    ) -> CodegenResult<Option<UnwindInfo>>;
    fn text_section_builder(
        &self,
        num_labeled_funcs: u32
    ) -> Box<dyn TextSectionBuilder>;
    fn function_alignment(&self) -> u32;

    // Provided methods
    fn map_regalloc_reg_to_dwarf(
        &self,
        _: Reg
    ) -> Result<u16, RegisterMappingError> { ... }
    fn create_systemv_cie(&self) -> Option<CommonInformationEntry> { ... }
}
Expand description

Methods that are specialized to a target ISA.

Implies a Display trait that shows the shared flags, as well as any ISA-specific flags.

Required Methods§

source

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

Get the name of this ISA.

source

fn triple(&self) -> &Triple

Get the target triple that was used to make this trait object.

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 dynamic_vector_bytes(&self, dynamic_ty: Type) -> u32

Get the ISA-dependent maximum vector register size, in bytes.

source

fn compile_function( &self, func: &Function, want_disasm: bool ) -> CodegenResult<CompiledCodeBase<Stencil>>

Compile the given function.

source

fn unsigned_add_overflow_condition(&self) -> IntCC

IntCC condition for Unsigned Addition Overflow (Carry).

source

fn emit_unwind_info( &self, result: &CompiledCode, kind: UnwindInfoKind ) -> CodegenResult<Option<UnwindInfo>>

Creates unwind information for the function.

Returns None if there is no unwind information for the function.

source

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

Returns an object that can be used to build the text section of an executable.

This object will internally attempt to handle as many relocations as possible using relative calls/jumps/etc between functions.

The num_labeled_funcs argument here is the number of functions which will be “labeled” or might have calls between them, typically the number of defined functions in the object file.

source

fn function_alignment(&self) -> u32

The function alignment required by this ISA.

Provided Methods§

source

fn map_regalloc_reg_to_dwarf(&self, _: Reg) -> Result<u16, RegisterMappingError>

Map a regalloc::Reg to its corresponding DWARF register.

source

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

Creates a new System V Common Information Entry for the ISA.

Returns None if the ISA does not support System V unwind information.

Implementations§

source§

impl<'a> dyn TargetIsa + 'a

Methods implemented for free for target ISA!

source

pub fn default_call_conv(&self) -> CallConv

Get the default calling convention of this target.

source

pub fn endianness(&self) -> Endianness

Get the endianness of this ISA.

source

pub fn code_section_alignment(&self) -> u64

Returns the code (text) section alignment for this ISA.

source

pub fn symbol_alignment(&self) -> u64

Returns the minimum symbol alignment for this ISA.

source

pub fn pointer_type(&self) -> Type

Get the pointer type of this ISA.

source

pub fn pointer_bits(&self) -> u8

Get the width of pointers on this ISA, in units of bits.

source

pub fn pointer_bytes(&self) -> u8

Get the width of pointers on this ISA, in units of bytes.

source

pub fn frontend_config(&self) -> TargetFrontendConfig

Get the information needed by frontends producing Cranelift IR.

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
source§

impl<'a> From<&'a dyn TargetIsa> for FlagsOrIsa<'a>

source§

fn from(isa: &'a dyn TargetIsa) -> FlagsOrIsa<'_>

Converts to this type from the input type.

Implementors§