Skip to content

Commit 722e392

Browse files
committed
refactor(compiler): inline runtime trap branch
Remove the single-use trapOnFalse wrapper while preserving the existing checked runtime-status control flow.
1 parent 4a4a3bf commit 722e392

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

compiler/array.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,6 @@ func (c *Compiler) CreateArrayForType(elem Type, length llvm.Value) llvm.Value {
181181
func (c *Compiler) trapOnRuntimeError(status llvm.Value, name string) {
182182
zero := llvm.ConstInt(status.Type(), 0, false)
183183
ok := c.builder.CreateICmp(llvm.IntEQ, status, zero, name+"_ok")
184-
c.trapOnFalse(ok, name)
185-
}
186-
187-
func (c *Compiler) trapOnFalse(ok llvm.Value, name string) {
188184
fn := c.builder.GetInsertBlock().Parent()
189185
failBlock := c.Context.AddBasicBlock(fn, name+"_fail")
190186
contBlock := c.Context.AddBasicBlock(fn, name+"_cont")

0 commit comments

Comments
 (0)