summaryrefslogtreecommitdiff
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
commit3e6438c46c4d23aea1a30b8586ec5c439cf306e1 (patch)
tree3bd763841fa1c27d630be6b5373d0cce4a7f0c47 /llgo
parentdd2906ffd9b2b091721633b3de07f9cb29d2e5c3 (diff)
[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
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