Improved code generation

This commit is contained in:
2024-07-09 12:43:29 +02:00
parent 8103faa8b6
commit 1204591cdc
4 changed files with 12 additions and 7 deletions

View File

@ -47,13 +47,6 @@ func NewFunction(name string, file *fs.File, body token.List) *Function {
func (f *Function) Compile() {
defer close(f.finished)
f.assembler.Label(asm.LABEL, f.Name)
for _, register := range f.cpu.Input {
if f.cpu.IsUsed(register) {
f.SaveRegister(register)
}
}
f.err = f.CompileTokens(f.Body)
f.assembler.Return()
}