• Than McIntosh's avatar
    [dev.link] cmd/link: add support to new deadcode for field tracking · 219922e9
    Than McIntosh authored
    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: default avatarCherry Zhang <cherryyz@google.com>
    219922e9
lib.go 73 KB