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

    // Required methods
    fn emit(
        &self,
        allocs: &[Allocation],
        code: &mut MachBuffer<Self>,
        info: &Self::Info,
        state: &mut Self::State
    );
    fn pretty_print_inst(
        &self,
        allocs: &[Allocation],
        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, allocs: &[Allocation], code: &mut MachBuffer<Self>, info: &Self::Info, state: &mut Self::State )

Emit the instruction.

source

fn pretty_print_inst( &self, allocs: &[Allocation], state: &mut Self::State ) -> String

Pretty-print the instruction.

Implementors§