cl: callRuntimeInit; runtime: TracePanic

This commit is contained in:
xushiwei
2024-05-01 11:03:52 +08:00
parent 673b9d9a5c
commit 666808b427
31 changed files with 330 additions and 102 deletions

View File

@@ -73,7 +73,9 @@ func (b Builder) Panic(v Expr) {
if debugInstr {
log.Printf("Panic %v\n", v.impl)
}
b.impl.CreateUnreachable() // TODO(xsw): pass v
pkg := b.fn.pkg
b.Call(pkg.rtFunc("TracePanic"), v)
b.impl.CreateUnreachable()
}
// Unreachable emits an unreachable instruction.