llgo/ssa: support string/cstring; panic

This commit is contained in:
xushiwei
2024-04-28 09:55:54 +08:00
parent 510f2f4769
commit 7039cb3bc2
7 changed files with 109 additions and 7 deletions

View File

@@ -387,6 +387,9 @@ func (p *context) compileInstr(b llssa.Builder, instr ssa.Instruction) {
thenb := fn.Block(succs[0].Index)
elseb := fn.Block(succs[1].Index)
b.If(cond, thenb, elseb)
case *ssa.Panic:
arg := p.compileValue(b, v.X).Do()
b.Panic(arg)
default:
panic(fmt.Sprintf("compileInstr: unknown instr - %T\n", instr))
}