Improved code generation

This commit is contained in:
2024-07-09 17:00:04 +02:00
parent 1204591cdc
commit 4386392844
23 changed files with 201 additions and 95 deletions

View File

@ -43,7 +43,7 @@ func (f *Function) CompileDefinition(node *ast.Define) error {
func (f *Function) AddVariable(variable *Variable) {
if config.Comments {
f.assembler.Comment(fmt.Sprintf("%s = %s (%s, %d uses)", variable.Name, variable.Value, variable.Register, variable.Alive))
f.Comment(fmt.Sprintf("%s = %s (%s, %d uses)", variable.Name, variable.Value, variable.Register, variable.Alive))
}
f.variables[variable.Name] = variable
@ -60,7 +60,7 @@ func (f *Function) useVariable(variable *Variable) {
if variable.Alive == 0 {
if config.Comments {
f.assembler.Comment(fmt.Sprintf("%s died (%s)", variable.Name, variable.Register))
f.Comment(fmt.Sprintf("%s died (%s)", variable.Name, variable.Register))
}
f.cpu.Free(variable.Register)