forked from OSchip/llvm-project
[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
This commit is contained in:
parent
6413f8a8f2
commit
78ac1f1d42
|
@ -154,9 +154,6 @@ func (d *DIBuilder) Value(b llvm.Builder, v ssa.Value, llv llvm.Value, paramInde
|
|||
|
||||
// SetLocation sets the current debug location.
|
||||
func (d *DIBuilder) SetLocation(b llvm.Builder, pos token.Pos) {
|
||||
if !pos.IsValid() {
|
||||
return
|
||||
}
|
||||
position := d.fset.Position(pos)
|
||||
d.lb = llvm.Metadata{}
|
||||
if position.Filename != d.fnFile && position.Filename != "" {
|
||||
|
|
|
@ -327,7 +327,7 @@ func (u *unit) defineFunction(f *ssa.Function) {
|
|||
fr.addCommonFunctionAttrs(fr.function)
|
||||
fr.function.SetLinkage(linkage)
|
||||
|
||||
fr.logf("Define function: %s", f.String())
|
||||
fr.logf("Define function: %s @ %s", f.String(), fr.pkg.Prog.Fset.Position(f.Pos()))
|
||||
fti := u.llvmtypes.getSignatureInfo(f.Signature)
|
||||
delete(u.undefinedFuncs, f)
|
||||
fr.retInf = fti.retInf
|
||||
|
|
Loading…
Reference in New Issue