c.AllocaCStrs; cl/_testlibc: allocacstrs

This commit is contained in:
xushiwei
2024-07-13 12:24:06 +08:00
parent e138951e9e
commit 022e46ae38
4 changed files with 144 additions and 3 deletions

View File

@@ -277,14 +277,14 @@ func (b Builder) Times(n Expr, loop func(i Expr)) {
loop(phi.Expr)
post := b.BinOp(token.ADD, phi.Expr, b.Prog.IntVal(1, typ))
b.Jump(blks[0])
b.SetBlockEx(blks[2], AtEnd, false)
b.blk.last = blks[2].last
phi.AddIncoming(b, []BasicBlock{at, blks[1]}, func(i int, blk BasicBlock) Expr {
if i == 0 {
return b.Prog.IntVal(0, typ)
}
return post
})
b.SetBlockEx(blks[2], AtEnd, false)
b.blk.last = blks[2].last
}
// -----------------------------------------------------------------------------