[meta] Remove OperandKind::name field and explicitly pass rust_field_name/rust_type; (fixes #1177)

This commit is contained in:
Benjamin Bouvier
2019-10-29 15:46:06 +01:00
parent 0eb2dfc4a3
commit d5e990220e
9 changed files with 123 additions and 170 deletions

View File

@@ -914,12 +914,12 @@ fn gen_inst_builder(inst: &Instruction, format: &InstructionFormat, fmt: &mut Fo
let mut into_args = Vec::new();
for op in &inst.operands_in {
let t = if op.is_immediate() {
let t = format!("T{}{}", tmpl_types.len() + 1, op.kind.name);
let t = format!("T{}", tmpl_types.len() + 1);
tmpl_types.push(format!("{}: Into<{}>", t, op.kind.rust_type));
into_args.push(op.name);
t
} else {
op.kind.rust_type.clone()
op.kind.rust_type.to_string()
};
args.push(format!("{}: {}", op.name, t));
args_doc.push(format!(