Refactored ssa to asm compilation
All checks were successful
/ test (push) Successful in 15s

This commit is contained in:
Eduard Urbach 2025-07-01 16:13:12 +02:00
parent 562c839835
commit c9c6b94c18
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
8 changed files with 133 additions and 86 deletions

20
src/core/CreateLabel.go Normal file
View file

@ -0,0 +1,20 @@
package core
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 *Function) 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()}
}