llvm.org GIT mirror llvm / e562960
[bindings/go] Add DebugLoc parameter to InsertXXXAtEnd() These functions previously passed nil for the location, which always resulted in a crash. This is a signature breaking change, but I cannot see how they could have been used before. Patch by Ben Clayton! Differential Revision: https://reviews.llvm.org/D51970 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342179 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 1 year, 1 month ago
1 changed file(s) with 8 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
564564
565565 // InsertDeclareAtEnd inserts a call to llvm.dbg.declare at the end of the
566566 // specified basic block for the given value and associated debug metadata.
567 func (d *DIBuilder) InsertDeclareAtEnd(v Value, diVarInfo, expr Metadata, bb BasicBlock) Value {
568 result := C.LLVMDIBuilderInsertDeclareAtEnd(d.ref, v.C, diVarInfo.C, expr.C, nil, bb.C)
567 func (d *DIBuilder) InsertDeclareAtEnd(v Value, diVarInfo, expr Metadata, l DebugLoc, bb BasicBlock) Value {
568 loc := C.LLVMDIBuilderCreateDebugLocation(
569 d.m.Context().C, C.uint(l.Line), C.uint(l.Col), l.Scope.C, l.InlinedAt.C)
570 result := C.LLVMDIBuilderInsertDeclareAtEnd(d.ref, v.C, diVarInfo.C, expr.C, loc, bb.C)
569571 return Value{C: result}
570572 }
571573
572574 // InsertValueAtEnd inserts a call to llvm.dbg.value at the end of the
573575 // specified basic block for the given value and associated debug metadata.
574 func (d *DIBuilder) InsertValueAtEnd(v Value, diVarInfo, expr Metadata, bb BasicBlock) Value {
575 result := C.LLVMDIBuilderInsertDbgValueAtEnd(d.ref, v.C, diVarInfo.C, expr.C, nil, bb.C)
576 func (d *DIBuilder) InsertValueAtEnd(v Value, diVarInfo, expr Metadata, l DebugLoc, bb BasicBlock) Value {
577 loc := C.LLVMDIBuilderCreateDebugLocation(
578 d.m.Context().C, C.uint(l.Line), C.uint(l.Col), l.Scope.C, l.InlinedAt.C)
579 result := C.LLVMDIBuilderInsertDbgValueAtEnd(d.ref, v.C, diVarInfo.C, expr.C, loc, bb.C)
576580 return Value{C: result}
577581 }
578582