implement-modules #43
@ -178,8 +178,15 @@ func (this *Block) SetTerminator (terminator Terminator) {
|
|||||||
func (this *Block) assignIDs (counter *int) {
|
func (this *Block) assignIDs (counter *int) {
|
||||||
for _, instruction := range this.Instructions {
|
for _, instruction := range this.Instructions {
|
||||||
if instruction, ok := instruction.(ValueInstruction); ok {
|
if instruction, ok := instruction.(ValueInstruction); ok {
|
||||||
instruction.SetName(fmt.Sprint(*counter))
|
if !isVoid(instruction) {
|
||||||
*counter ++
|
instruction.SetName(fmt.Sprint(*counter))
|
||||||
|
*counter ++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isVoid (instruction ValueInstruction) bool {
|
||||||
|
_, ok := instruction.Type().(*TypeVoid)
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user