[meta] Remove unused immfield index in the FormatField;
This commit is contained in:
@@ -12,9 +12,6 @@ use cranelift_entity::{entity_impl, PrimaryMap};
|
|||||||
/// data type.
|
/// data type.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct FormatField {
|
pub struct FormatField {
|
||||||
/// Immediate operand number in parent.
|
|
||||||
immnum: usize,
|
|
||||||
|
|
||||||
/// Immediate operand kind.
|
/// Immediate operand kind.
|
||||||
pub kind: OperandKind,
|
pub kind: OperandKind,
|
||||||
|
|
||||||
@@ -53,7 +50,7 @@ pub struct InstructionFormat {
|
|||||||
|
|
||||||
impl fmt::Display for InstructionFormat {
|
impl fmt::Display for InstructionFormat {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
let args = self
|
let imm_args = self
|
||||||
.imm_fields
|
.imm_fields
|
||||||
.iter()
|
.iter()
|
||||||
.map(|field| format!("{}: {}", field.member, field.kind.name))
|
.map(|field| format!("{}: {}", field.member, field.kind.name))
|
||||||
@@ -61,7 +58,7 @@ impl fmt::Display for InstructionFormat {
|
|||||||
.join(", ");
|
.join(", ");
|
||||||
fmt.write_fmt(format_args!(
|
fmt.write_fmt(format_args!(
|
||||||
"{}(imms=({}), vals={})",
|
"{}(imms=({}), vals={})",
|
||||||
self.name, args, self.num_value_operands
|
self.name, imm_args, self.num_value_operands
|
||||||
))?;
|
))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -112,7 +109,6 @@ impl InstructionFormatBuilder {
|
|||||||
|
|
||||||
pub fn imm(mut self, operand_kind: &OperandKind) -> Self {
|
pub fn imm(mut self, operand_kind: &OperandKind) -> Self {
|
||||||
let field = FormatField {
|
let field = FormatField {
|
||||||
immnum: self.imm_fields.len(),
|
|
||||||
kind: operand_kind.clone(),
|
kind: operand_kind.clone(),
|
||||||
member: operand_kind.default_member.unwrap(),
|
member: operand_kind.default_member.unwrap(),
|
||||||
};
|
};
|
||||||
@@ -122,7 +118,6 @@ impl InstructionFormatBuilder {
|
|||||||
|
|
||||||
pub fn imm_with_name(mut self, member: &'static str, operand_kind: &OperandKind) -> Self {
|
pub fn imm_with_name(mut self, member: &'static str, operand_kind: &OperandKind) -> Self {
|
||||||
let field = FormatField {
|
let field = FormatField {
|
||||||
immnum: self.imm_fields.len(),
|
|
||||||
kind: operand_kind.clone(),
|
kind: operand_kind.clone(),
|
||||||
member,
|
member,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user