llgo/ssa: unreachable

This commit is contained in:
xushiwei
2024-04-29 18:33:02 +08:00
parent 8c1b8ad945
commit e1d1d6a2d9
4 changed files with 59 additions and 0 deletions

View File

@@ -76,6 +76,11 @@ func (b Builder) Panic(v Expr) {
b.impl.CreateUnreachable() // TODO(xsw): pass v
}
// Unreachable emits an unreachable instruction.
func (b Builder) Unreachable() {
b.impl.CreateUnreachable()
}
// Return emits a return instruction.
func (b Builder) Return(results ...Expr) {
if debugInstr {