[meta] Remove name lookups in formats;
This does a lot at once, since there was no clear way to split the three commits: - Instruction need to be passed an explicit InstructionFormat, - InstructionFormat deduplication is checked once all entities have been defined;
This commit is contained in:
@@ -138,11 +138,11 @@ pub struct OperandKind {
|
||||
}
|
||||
|
||||
impl OperandKind {
|
||||
pub fn imm_key(&self) -> Option<String> {
|
||||
pub fn imm_name(&self) -> Option<&str> {
|
||||
match self.fields {
|
||||
OperandKindFields::ImmEnum(_)
|
||||
| OperandKindFields::ImmValue
|
||||
| OperandKindFields::EntityRef => Some(self.name.to_string()),
|
||||
| OperandKindFields::EntityRef => Some(&self.name),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user