cranelift_codegen

Trait MachInstEmit

Source
pub trait MachInstEmit: MachInst {
    type State: MachInstEmitState<Self>;
    type Info;

    // Required methods
    fn emit(
        &self,
        code: &mut MachBuffer<Self>,
        info: &Self::Info,
        state: &mut Self::State,
    );
    fn pretty_print_inst(&self, state: &mut Self::State) -> String;
}
Expand description

A trait describing the ability to encode a MachInst into binary machine code.

Required Associated Types§

Source

type State: MachInstEmitState<Self>

Persistent state carried across emit invocations.

Source

type Info

Constant information used in emit invocations.

Required Methods§

Source

fn emit( &self, code: &mut MachBuffer<Self>, info: &Self::Info, state: &mut Self::State, )

Emit the instruction.

Source

fn pretty_print_inst(&self, state: &mut Self::State) -> String

Pretty-print the instruction.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl MachInstEmit for cranelift_codegen::isa::aarch64::inst::Inst

Available on crate feature arm64 only.
Source§

impl MachInstEmit for cranelift_codegen::isa::x64::Inst

Available on crate feature x86 only.