Improved ssa compiler
All checks were successful
/ test (push) Successful in 15s

This commit is contained in:
Eduard Urbach 2025-07-02 16:55:24 +02:00
parent c9c6b94c18
commit 3301cf5542
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
49 changed files with 690 additions and 262 deletions

View file

@ -0,0 +1,20 @@
package ssa2asm
import (
"strconv"
"strings"
"git.urbach.dev/cli/q/src/asm"
)
// CreateLabel creates a label that is tied to this function by using a suffix.
func (f *Compiler) CreateLabel(prefix string, count Counter) *asm.Label {
tmp := strings.Builder{}
tmp.WriteString(prefix)
tmp.WriteString(" ")
tmp.WriteString(strconv.FormatUint(uint64(count), 10))
tmp.WriteString(" [")
tmp.WriteString(f.UniqueName)
tmp.WriteString("]")
return &asm.Label{Name: tmp.String()}
}