This commit is contained in:
parent
2b703e9af2
commit
70c2da4a4d
40 changed files with 821 additions and 117 deletions
|
@ -1,9 +1,5 @@
|
|||
package ssa
|
||||
|
||||
import (
|
||||
"git.urbach.dev/cli/q/src/cpu"
|
||||
)
|
||||
|
||||
// IR is a list of basic blocks.
|
||||
type IR struct {
|
||||
Blocks []*Block
|
||||
|
@ -44,8 +40,8 @@ func (f *IR) AppendInt(x int) *Int {
|
|||
}
|
||||
|
||||
// AppendRegister adds a new register value to the last block.
|
||||
func (f *IR) AppendRegister(reg cpu.Register) *Register {
|
||||
v := &Register{Register: reg}
|
||||
func (f *IR) AppendRegister(index int) *Parameter {
|
||||
v := &Parameter{Index: uint8(index)}
|
||||
f.Append(v)
|
||||
return v
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue