diff options
author | Russ Cox <rsc@golang.org> | 2021-01-22 11:13:32 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2021-02-19 00:04:49 +0000 |
commit | a1222b75350a098e70106bf95d4e6a962c37f373 (patch) | |
tree | a23504d92bea55a9900c2f4bf736018cbc2ef0b9 /src/cmd/link/internal/ld/deadcode.go | |
parent | 1c659f25257f29003b7012d90072b63f88d12f8b (diff) | |
download | go-a1222b75350a098e70106bf95d4e6a962c37f373.tar.gz go-a1222b75350a098e70106bf95d4e6a962c37f373.zip |
cmd/link: add debug print in deadcode
This matches the prints that deadcode prints later
as the algorithm progresses under -v=2.
It helps to see the initial conditions with -v=2 as well.
Change-Id: I06ae86fe9bd8314d003148f3d941832c9b10aef1
Reviewed-on: https://go-review.googlesource.com/c/go/+/288817
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/link/internal/ld/deadcode.go')
-rw-r--r-- | src/cmd/link/internal/ld/deadcode.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go index 245076a83a..1874103b93 100644 --- a/src/cmd/link/internal/ld/deadcode.go +++ b/src/cmd/link/internal/ld/deadcode.go @@ -91,6 +91,10 @@ func (d *deadcodePass) init() { names = append(names, exp) } + if d.ctxt.Debugvlog > 1 { + d.ctxt.Logf("deadcode start names: %v\n", names) + } + for _, name := range names { // Mark symbol as a data/ABI0 symbol. d.mark(d.ldr.Lookup(name, 0), 0) |