cl: TestVar done

This commit is contained in:
xushiwei
2024-04-20 22:05:45 +08:00
parent 55a757b9f8
commit 3509ac9c17
6 changed files with 181 additions and 35 deletions

View File

@@ -73,6 +73,14 @@ func (b Builder) Return(results ...Expr) {
}
}
// Jump emits a jump instruction.
func (b Builder) Jump(jmpb BasicBlock) {
if b.fn != jmpb.fn {
panic("mismatched function")
}
b.impl.CreateBr(jmpb.impl)
}
// If emits an if instruction.
func (b Builder) If(cond Expr, thenb, elseb BasicBlock) {
if b.fn != thenb.fn || b.fn != elseb.fn {