SetBlockEx: BeforeLast

This commit is contained in:
xushiwei
2024-05-26 16:18:24 +08:00
parent 5cf6a30027
commit ddabfdca3d
9 changed files with 181 additions and 137 deletions

View File

@@ -80,6 +80,7 @@ type InsertPoint int
const (
AtEnd InsertPoint = iota
AtStart
BeforeLast
afterInit
)
@@ -93,6 +94,8 @@ func (b Builder) SetBlockEx(blk BasicBlock, pos InsertPoint, setBlk bool) Builde
b.impl.SetInsertPointAtEnd(blk.last)
case AtStart:
b.impl.SetInsertPointBefore(blk.first.FirstInstruction())
case BeforeLast:
b.impl.SetInsertPointBefore(blk.last.LastInstruction())
case afterInit:
b.impl.SetInsertPointBefore(instrAfterInit(blk.first))
default: