implement-modules #43
@ -178,8 +178,15 @@ func (this *Block) SetTerminator (terminator Terminator) {
|
||||
func (this *Block) assignIDs (counter *int) {
|
||||
for _, instruction := range this.Instructions {
|
||||
if instruction, ok := instruction.(ValueInstruction); ok {
|
||||
instruction.SetName(fmt.Sprint(*counter))
|
||||
*counter ++
|
||||
if !isVoid(instruction) {
|
||||
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