[meta] Remove unused InstructionGroup::{name, doc};
This commit is contained in:
@@ -23,8 +23,6 @@ entity_impl!(OpcodeNumber);
|
|||||||
pub(crate) type AllInstructions = PrimaryMap<OpcodeNumber, Instruction>;
|
pub(crate) type AllInstructions = PrimaryMap<OpcodeNumber, Instruction>;
|
||||||
|
|
||||||
pub(crate) struct InstructionGroupBuilder<'format_reg, 'all_inst> {
|
pub(crate) struct InstructionGroupBuilder<'format_reg, 'all_inst> {
|
||||||
_name: &'static str,
|
|
||||||
_doc: &'static str,
|
|
||||||
format_registry: &'format_reg FormatRegistry,
|
format_registry: &'format_reg FormatRegistry,
|
||||||
all_instructions: &'all_inst mut AllInstructions,
|
all_instructions: &'all_inst mut AllInstructions,
|
||||||
own_instructions: Vec<Instruction>,
|
own_instructions: Vec<Instruction>,
|
||||||
@@ -32,14 +30,10 @@ pub(crate) struct InstructionGroupBuilder<'format_reg, 'all_inst> {
|
|||||||
|
|
||||||
impl<'format_reg, 'all_inst> InstructionGroupBuilder<'format_reg, 'all_inst> {
|
impl<'format_reg, 'all_inst> InstructionGroupBuilder<'format_reg, 'all_inst> {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
name: &'static str,
|
|
||||||
doc: &'static str,
|
|
||||||
all_instructions: &'all_inst mut AllInstructions,
|
all_instructions: &'all_inst mut AllInstructions,
|
||||||
format_registry: &'format_reg FormatRegistry,
|
format_registry: &'format_reg FormatRegistry,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
_name: name,
|
|
||||||
_doc: doc,
|
|
||||||
format_registry,
|
format_registry,
|
||||||
all_instructions,
|
all_instructions,
|
||||||
own_instructions: Vec::new(),
|
own_instructions: Vec::new(),
|
||||||
@@ -56,8 +50,6 @@ impl<'format_reg, 'all_inst> InstructionGroupBuilder<'format_reg, 'all_inst> {
|
|||||||
|
|
||||||
pub fn build(self) -> InstructionGroup {
|
pub fn build(self) -> InstructionGroup {
|
||||||
InstructionGroup {
|
InstructionGroup {
|
||||||
_name: self._name,
|
|
||||||
_doc: self._doc,
|
|
||||||
instructions: self.own_instructions,
|
instructions: self.own_instructions,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,8 +59,6 @@ impl<'format_reg, 'all_inst> InstructionGroupBuilder<'format_reg, 'all_inst> {
|
|||||||
/// target architecture can support instructions from multiple groups, and it
|
/// target architecture can support instructions from multiple groups, and it
|
||||||
/// does not necessarily support all instructions in a group.
|
/// does not necessarily support all instructions in a group.
|
||||||
pub(crate) struct InstructionGroup {
|
pub(crate) struct InstructionGroup {
|
||||||
_name: &'static str,
|
|
||||||
_doc: &'static str,
|
|
||||||
instructions: Vec<Instruction>,
|
instructions: Vec<Instruction>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ fn test_double_custom_legalization() {
|
|||||||
let mut dummy_all = AllInstructions::new();
|
let mut dummy_all = AllInstructions::new();
|
||||||
let mut format = FormatRegistry::new();
|
let mut format = FormatRegistry::new();
|
||||||
format.insert(InstructionFormatBuilder::new("nullary"));
|
format.insert(InstructionFormatBuilder::new("nullary"));
|
||||||
let mut inst_group = InstructionGroupBuilder::new("test", "", &mut dummy_all, &format);
|
let mut inst_group = InstructionGroupBuilder::new(&mut dummy_all, &format);
|
||||||
inst_group.push(InstructionBuilder::new("dummy", "doc"));
|
inst_group.push(InstructionBuilder::new("dummy", "doc"));
|
||||||
let inst_group = inst_group.build();
|
let inst_group = inst_group.build();
|
||||||
let dummy_inst = inst_group.by_name("dummy");
|
let dummy_inst = inst_group.by_name("dummy");
|
||||||
|
|||||||
@@ -54,8 +54,6 @@ pub(crate) fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
|||||||
let regs = define_regs();
|
let regs = define_regs();
|
||||||
|
|
||||||
let inst_group = InstructionGroupBuilder::new(
|
let inst_group = InstructionGroupBuilder::new(
|
||||||
"arm32",
|
|
||||||
"arm32 specific instruction set",
|
|
||||||
&mut shared_defs.all_instructions,
|
&mut shared_defs.all_instructions,
|
||||||
&shared_defs.format_registry,
|
&shared_defs.format_registry,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ pub(crate) fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
|||||||
let regs = define_registers();
|
let regs = define_registers();
|
||||||
|
|
||||||
let inst_group = InstructionGroupBuilder::new(
|
let inst_group = InstructionGroupBuilder::new(
|
||||||
"arm64",
|
|
||||||
"arm64 specific instruction set",
|
|
||||||
&mut shared_defs.all_instructions,
|
&mut shared_defs.all_instructions,
|
||||||
&shared_defs.format_registry,
|
&shared_defs.format_registry,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -90,8 +90,6 @@ pub(crate) fn define(shared_defs: &mut SharedDefinitions) -> TargetIsa {
|
|||||||
let regs = define_registers();
|
let regs = define_registers();
|
||||||
|
|
||||||
let inst_group = InstructionGroupBuilder::new(
|
let inst_group = InstructionGroupBuilder::new(
|
||||||
"riscv",
|
|
||||||
"riscv specific instruction set",
|
|
||||||
&mut shared_defs.all_instructions,
|
&mut shared_defs.all_instructions,
|
||||||
&shared_defs.format_registry,
|
&shared_defs.format_registry,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -15,12 +15,7 @@ pub(crate) fn define(
|
|||||||
format_registry: &FormatRegistry,
|
format_registry: &FormatRegistry,
|
||||||
immediates: &Immediates,
|
immediates: &Immediates,
|
||||||
) -> InstructionGroup {
|
) -> InstructionGroup {
|
||||||
let mut ig = InstructionGroupBuilder::new(
|
let mut ig = InstructionGroupBuilder::new(&mut all_instructions, format_registry);
|
||||||
"x86",
|
|
||||||
"x86 specific instruction set",
|
|
||||||
&mut all_instructions,
|
|
||||||
format_registry,
|
|
||||||
);
|
|
||||||
|
|
||||||
let iflags: &TypeVar = &ValueType::Special(types::Flag::IFlags.into()).into();
|
let iflags: &TypeVar = &ValueType::Special(types::Flag::IFlags.into()).into();
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,7 @@ pub(crate) fn define(
|
|||||||
imm: &Immediates,
|
imm: &Immediates,
|
||||||
entities: &EntityRefs,
|
entities: &EntityRefs,
|
||||||
) -> InstructionGroup {
|
) -> InstructionGroup {
|
||||||
let mut ig = InstructionGroupBuilder::new(
|
let mut ig = InstructionGroupBuilder::new(all_instructions, format_registry);
|
||||||
"base",
|
|
||||||
"Shared base instruction set",
|
|
||||||
all_instructions,
|
|
||||||
format_registry,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Operand kind shorthands.
|
// Operand kind shorthands.
|
||||||
let iflags: &TypeVar = &ValueType::Special(types::Flag::IFlags.into()).into();
|
let iflags: &TypeVar = &ValueType::Special(types::Flag::IFlags.into()).into();
|
||||||
|
|||||||
Reference in New Issue
Block a user