]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: add debug print in deadcode
authorRuss Cox <rsc@golang.org>
Fri, 22 Jan 2021 16:13:32 +0000 (11:13 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 19 Feb 2021 00:04:49 +0000 (00:04 +0000)
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>
src/cmd/link/internal/ld/deadcode.go

index 245076a83a5c32c204c0a28d03e7059dfa2f9300..1874103b932f848e82b145c96f909d22719d20a4 100644 (file)
@@ -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)