cranelift_codegen/machinst/inst_common.rs
1//! A place to park MachInst::Inst fragments which are common across multiple architectures.
2
3use crate::ir::Inst as IRInst;
4
5//============================================================================
6// Instruction input "slots".
7//
8// We use these types to refer to operand numbers, and result numbers, together
9// with the associated instruction, in a type-safe way.
10
11/// Identifier for a particular input of an instruction.
12#[derive(Clone, Copy, Debug, PartialEq, Eq)]
13pub(crate) struct InsnInput {
14 pub(crate) insn: IRInst,
15 pub(crate) input: usize,
16}
17
18/// Identifier for a particular output of an instruction.
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20#[allow(dead_code)]
21pub(crate) struct InsnOutput {
22 pub(crate) insn: IRInst,
23 pub(crate) output: usize,
24}