ssa: ChangeInterface

This commit is contained in:
visualfc
2024-06-03 16:03:05 +08:00
parent 7596658e6c
commit 193e6dfc93
7 changed files with 539 additions and 331 deletions

View File

@@ -761,6 +761,10 @@ func (p *context) compileInstrOrValue(b llssa.Builder, iv instrOrValue, asValue
case *ssa.Next:
iter := p.compileValue(b, v.Iter)
ret = b.Next(iter, v.IsString)
case *ssa.ChangeInterface:
t := v.Type()
x := p.compileValue(b, v.X)
ret = b.ChangeInterface(p.prog.Type(t, llssa.InGo), x)
default:
panic(fmt.Sprintf("compileInstrAndValue: unknown instr - %T\n", iv))
}