implement-modules #43

Closed
sashakoshka wants to merge 502 commits from implement-modules into main
Showing only changes of commit 2353ecd0e1 - Show all commits

View File

@ -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
}