[meta] Delegate finding the default value to OperandKind instead of its builder.

This applies both to the default_member value (which is now determined at
runtime, instead of pre-computed) and the rust_type value (which is
determined in the Operand's ctor, instead of the builder).
This commit is contained in:
Benjamin Bouvier
2019-10-29 15:18:45 +01:00
parent 4632d35196
commit ae3ea47dbd
3 changed files with 67 additions and 61 deletions

View File

@@ -127,7 +127,7 @@ impl InstructionFormatBuilder {
pub fn imm(mut self, operand_kind: &OperandKind) -> Self {
let field = FormatField {
kind: operand_kind.clone(),
member: operand_kind.default_member.unwrap(),
member: operand_kind.default_member().unwrap(),
};
self.imm_fields.push(field);
self