summaryrefslogtreecommitdiffstats
path: root/llgo
diff options
context:
space:
mode:
authorAndrew Wilkins <axwalk@gmail.com>2016-12-06 05:39:14 +0000
committerAndrew Wilkins <axwalk@gmail.com>2016-12-06 05:39:14 +0000
commit78ac1f1d42c8415ff0a84e1614bfe076b45ed061 (patch)
treedf94eb7bacd8a4315b5377c7dd0ee8da16b339f9 /llgo
parent6413f8a8f2987e4c05afa91cc87ee1d0ce609805 (diff)
downloadbcm5719-llvm-78ac1f1d42c8415ff0a84e1614bfe076b45ed061.tar.gz
bcm5719-llvm-78ac1f1d42c8415ff0a84e1614bfe076b45ed061.zip
[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
Diffstat (limited to 'llgo')
-rw-r--r--llgo/debug/debug.go3
-rw-r--r--llgo/irgen/ssa.go2
2 files changed, 1 insertions, 4 deletions
diff --git a/llgo/debug/debug.go b/llgo/debug/debug.go
index 4331c9cea13..bd07d0adb09 100644
--- a/llgo/debug/debug.go
+++ b/llgo/debug/debug.go
@@ -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 != "" {
diff --git a/llgo/irgen/ssa.go b/llgo/irgen/ssa.go
index aada41cfd0c..f1c9d04456e 100644
--- a/llgo/irgen/ssa.go
+++ b/llgo/irgen/ssa.go
@@ -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
OpenPOWER on IntegriCloud