This commit is contained in:
parent
89f375f4fc
commit
14bccadd0f
7 changed files with 54 additions and 16 deletions
|
@ -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]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue