]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: add support to new deadcode for field tracking
authorThan McIntosh <thanm@google.com>
Wed, 30 Oct 2019 16:31:55 +0000 (12:31 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 1 Nov 2019 13:54:58 +0000 (13:54 +0000)
commit219922e95b8e49cfb94da9de0c48edb22a2e7054
tree81c6118d5b69f0fef1b6f5d9a75493bc55390cf7
parent63815923fc7ef8dd9b6ae04b791e2811d74f9c1b
[dev.link] cmd/link: add support to new deadcode for field tracking

Fix up the new dead code pass to include support for populating the
ctxt "Reachparent" map, which is needed to support field tracking.
Since we don't have sym.Symbols created at the point where new dead
code runs, keep track of reachability using global symbol indices, and
then once loader.LoadFull is complete we can translate the index
mappings into symbol mappings.

The fieldtracking output is unfortunately different relative to
master, due to differences in the order in which symbols are
encountered in deadcode, but I have eyeballed the results to make sure
they look reasonable.

Change-Id: I48c7a4597f05c00f15af3bfd37fc15ab4d0017c2
Reviewed-on: https://go-review.googlesource.com/c/go/+/204342
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/internal/ld/deadcode2.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/loader/loader.go