aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-08-18 14:42:12 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-08-18 23:19:19 +0000
commit322879d5c9dc34975a42ac77fbef7b4a8b255e8a (patch)
tree7c91d441fad3b68a4010f22288af3a5f6de56eea /src/cmd/compile
parent687f2acf6ae00226e8304e15f156f36e19ac971f (diff)
downloadgo-322879d5c9dc34975a42ac77fbef7b4a8b255e8a.tar.gz
go-322879d5c9dc34975a42ac77fbef7b4a8b255e8a.zip
cmd/compile/internal/dwarfgen: use src.Pos.Rel{Filename,Line,Col} consistently
It appears that this code predates golang.org/cl/96535, which added RelCol to support /*line*/ directives. Change-Id: Ib79cebc1be53af706e84e8799eeea81ef8c81c8b Reviewed-on: https://go-review.googlesource.com/c/go/+/343430 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd/compile')
-rw-r--r--src/cmd/compile/internal/dwarfgen/dwarf.go6
-rw-r--r--src/cmd/compile/internal/dwarfgen/dwinl.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/dwarfgen/dwarf.go b/src/cmd/compile/internal/dwarfgen/dwarf.go
index 0e22b61bc3..30472a9ebd 100644
--- a/src/cmd/compile/internal/dwarfgen/dwarf.go
+++ b/src/cmd/compile/internal/dwarfgen/dwarf.go
@@ -214,7 +214,7 @@ func createDwarfVars(fnsym *obj.LSym, complexOK bool, fn *ir.Func, apDecls []*ir
Type: base.Ctxt.Lookup(typename),
DeclFile: declpos.RelFilename(),
DeclLine: declpos.RelLine(),
- DeclCol: declpos.Col(),
+ DeclCol: declpos.RelCol(),
InlIndex: int32(inlIndex),
ChildIndex: -1,
})
@@ -371,7 +371,7 @@ func createSimpleVar(fnsym *obj.LSym, n *ir.Name) *dwarf.Var {
Type: base.Ctxt.Lookup(typename),
DeclFile: declpos.RelFilename(),
DeclLine: declpos.RelLine(),
- DeclCol: declpos.Col(),
+ DeclCol: declpos.RelCol(),
InlIndex: int32(inlIndex),
ChildIndex: -1,
}
@@ -475,7 +475,7 @@ func createComplexVar(fnsym *obj.LSym, fn *ir.Func, varID ssa.VarID) *dwarf.Var
StackOffset: ssagen.StackOffset(debug.Slots[debug.VarSlots[varID][0]]),
DeclFile: declpos.RelFilename(),
DeclLine: declpos.RelLine(),
- DeclCol: declpos.Col(),
+ DeclCol: declpos.RelCol(),
InlIndex: int32(inlIndex),
ChildIndex: -1,
}
diff --git a/src/cmd/compile/internal/dwarfgen/dwinl.go b/src/cmd/compile/internal/dwarfgen/dwinl.go
index 8adb36fc88..c785e064a7 100644
--- a/src/cmd/compile/internal/dwarfgen/dwinl.go
+++ b/src/cmd/compile/internal/dwarfgen/dwinl.go
@@ -244,7 +244,7 @@ func makePreinlineDclMap(fnsym *obj.LSym) map[varPos]int {
DeclName: unversion(n.Sym().Name),
DeclFile: pos.RelFilename(),
DeclLine: pos.RelLine(),
- DeclCol: pos.Col(),
+ DeclCol: pos.RelCol(),
}
if _, found := m[vp]; found {
// We can see collisions (variables with the same name/file/line/col) in obfuscated or machine-generated code -- see issue 44378 for an example. Skip duplicates in such cases, since it is unlikely that a human will be debugging such code.