Implemented a basic API for SSA
All checks were successful
/ test (push) Successful in 16s

This commit is contained in:
Eduard Urbach 2025-06-20 23:42:58 +02:00
parent 89f375f4fc
commit 14bccadd0f
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
7 changed files with 54 additions and 16 deletions

View file

@ -1,11 +1,12 @@
package ssa
// Block is a list of instructions that can be targeted in branches.
type Block struct {
Entry []*Block
Instructions []Instruction
Exit []*Block
}
func (b *Block) Append(instr Instruction) {
// Append adds a new instruction to the block.
func (b *Block) Append(instr Instruction) *Instruction {
b.Instructions = append(b.Instructions, instr)
return &b.Instructions[len(b.Instructions)-1]
}