In the following section of code in the parsing into assembly AST nodes, there are some structs being initialised where the binding names match the field names in the struct (for which the compiler can make do with just the field names), but the binding name is still provided, which is redundant:
|
ir::Instruction::Return(val) => { |
|
let src = parse_operand(val); |
|
let dst = Operand::Register(Reg::AX); |
|
vec![Instruction::Mov { src: src, dst: dst }, Instruction::Ret] |
|
} |
|
ir::Instruction::Unary { op, src, dst } => { |
|
let op = parse_unary_operator(op); |
|
let src = parse_operand(src); |
|
let dst = parse_operand(dst); |
|
vec![ |
|
Instruction::Mov { |
|
src: src, |
|
dst: dst.clone(), |
|
}, |
|
Instruction::Unary { op: op, dst: dst }, |
|
] |
|
} |
In the following section of code in the parsing into assembly AST nodes, there are some structs being initialised where the binding names match the field names in the struct (for which the compiler can make do with just the field names), but the binding name is still provided, which is redundant:
c-compiler/src/parse/asm/first_pass.rs
Lines 33 to 49 in 2a55faa