Skip to content

Commit 78ac1f1

Browse files
committed
[llgo] set debuglocs for calls in synthetic functions
Synthesized functions do not have valid locations, and so we were not setting a debug location. Recent changes to DI require that function call instructions within a function having DI must have a location set. We just set the debug location to line=0, col=0. Reviewers: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D22905 llvm-svn: 288772
1 parent 6413f8a commit 78ac1f1

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

llgo/debug/debug.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ func (d *DIBuilder) Value(b llvm.Builder, v ssa.Value, llv llvm.Value, paramInde
154154

155155
// SetLocation sets the current debug location.
156156
func (d *DIBuilder) SetLocation(b llvm.Builder, pos token.Pos) {
157-
if !pos.IsValid() {
158-
return
159-
}
160157
position := d.fset.Position(pos)
161158
d.lb = llvm.Metadata{}
162159
if position.Filename != d.fnFile && position.Filename != "" {

llgo/irgen/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ func (u *unit) defineFunction(f *ssa.Function) {
327327
fr.addCommonFunctionAttrs(fr.function)
328328
fr.function.SetLinkage(linkage)
329329

330-
fr.logf("Define function: %s", f.String())
330+
fr.logf("Define function: %s @ %s", f.String(), fr.pkg.Prog.Fset.Position(f.Pos()))
331331
fti := u.llvmtypes.getSignatureInfo(f.Signature)
332332
delete(u.undefinedFuncs, f)
333333
fr.retInf = fti.retInf

0 commit comments

Comments
 (0)