Implemented a basic optimization
This commit is contained in:
parent
58d3aaf21d
commit
6102ab466a
8 changed files with 48 additions and 14 deletions
|
@ -21,10 +21,7 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) error {
|
|||
return errors.New(&errors.UnknownIdentifier{Name: name}, f.File, t.Position)
|
||||
}
|
||||
|
||||
if register != variable.Register {
|
||||
f.assembler.RegisterRegister(asm.MOVE, register, variable.Register)
|
||||
}
|
||||
|
||||
f.assembler.RegisterRegister(asm.MOVE, register, variable.Register)
|
||||
f.useVariable(variable)
|
||||
return nil
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue