llgo/ssa: ChangeType, Convert

This commit is contained in:
xushiwei
2024-04-28 06:23:21 +08:00
parent c97c1e97b9
commit 475f0fa2ff
2 changed files with 58 additions and 4 deletions

View File

@@ -300,6 +300,10 @@ func (p *context) compileInstrAndValue(b llssa.Builder, iv instrAndValue) (ret l
t := v.Type()
x := p.compileValue(b, v.X)
ret = b.ChangeType(p.prog.Type(t), x)
case *ssa.Convert:
t := v.Type()
x := p.compileValue(b, v.X)
ret = b.Convert(p.prog.Type(t), x)
case *ssa.FieldAddr:
x := p.compileValue(b, v.X)
ret = b.FieldAddr(x, v.Field)