Skip to content

Commit 904fa85

Browse files
aykevldeadprogram
authored andcommitted
transform: fix debug information in func lowering pass
This commit fixes errors like the following: inlinable function call in a function with debug info must have a !dbg location call void @runtime.nilPanic(i8* undef, i8* null) inlinable function call in a function with debug info must have a !dbg location %24 = call fastcc %runtime._interface @"(*github.com/vugu/vugu/domrender.JSRenderer).render$1"(%"github.com/vugu/vugu.VGNode"** %19, i32 %22, i32 %23, i8* %15, i8* undef) error: optimizations caused a verification failure Not all instructions had a debug location, which apparently caused issues for the inliner.
1 parent d0b2585 commit 904fa85

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

transform/func-lowering.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ func addFuncLoweringSwitch(mod llvm.Module, builder llvm.Builder, funcID, call l
225225
// in this gap.
226226
nextBlock := llvmutil.SplitBasicBlock(builder, sw, llvm.NextBasicBlock(sw.InstructionParent()), "func.next")
227227

228+
// Temporarily set the insert point to set the correct debug insert location
229+
// for the builder. It got destroyed by the SplitBasicBlock call.
230+
builder.SetInsertPointBefore(call)
231+
228232
// The 0 case, which is actually a nil check.
229233
nilBlock := ctx.InsertBasicBlock(nextBlock, "func.nil")
230234
builder.SetInsertPointAtEnd(nilBlock)

0 commit comments

Comments
 (0)