Something went wrong. Try again.
🌱 A minimal programming language and compiler. git.urbach.dev/cli/q
high-performance programming-language compiler
Something went wrong. Try again.
123456789101112131415161718192021package core
import ( "git.urbach.dev/cli/q/src/ssa" "git.urbach.dev/cli/q/src/token")
// multiplySize multiplies the `count` with the `size` if needed.func (f *Function) multiplySize(count ssa.Value, size int) ssa.Value { if size == 1 { return count }
sizeValue := f.Append(&ssa.Int{Int: size})
return f.Append(&ssa.BinaryOp{ Op: token.Mul, Left: count, Right: sizeValue, })}