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

@@ -68,6 +68,15 @@ func (b Builder) SetBlock(blk BasicBlock) Builder {
return b
}
// Panic emits a panic instruction.
func (b Builder) Panic(v Expr) {
if debugInstr {
log.Printf("Panic %v\n", v.impl)
}
pkg := b.fn.pkg
b.Call(pkg.rtAbort().Expr)
}
// Return emits a return instruction.
func (b Builder) Return(results ...Expr) {
if debugInstr {