]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: include register-resident output params in DWARF-gen
authorThan McIntosh <thanm@google.com>
Wed, 10 Nov 2021 15:44:00 +0000 (10:44 -0500)
committerThan McIntosh <thanm@google.com>
Thu, 11 Nov 2021 11:47:18 +0000 (11:47 +0000)
commit79e03a9281ba03f9f79904f074e2e343f2140bdd
tree09f6fbb0ba8199f6b797aa9396211c3c423f41bd
parente9ef931e0649563e800f0a284ad3606564a88b35
cmd/compile: include register-resident output params in DWARF-gen

During the register ABI work, a change was made in CL 302071 to
"stackframe" to treat register-resident output parameter (PARAMOUT)
variables that same as locals, which meant that if they were unused,
we'd delete them from the "Dcl" slice. This has the effect of making
them invisible to DWARF generation later on in the pipeline, meaning
that we don't get DIEs for them in the debug info. This patch fixes
the problem by capturing these params prior to optimization and then
adding them back in for consideration when we're processing the
params/locals of a function during DWARF generation.

Fixes #48573.

Change-Id: I2b32882911c18f91c3e3d009486517522d262685
Reviewed-on: https://go-review.googlesource.com/c/go/+/362618
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/dwarfgen/dwarf.go
src/cmd/compile/internal/ssa/debug.go
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/link/internal/ld/dwarf_test.go