diff options
author | Cherry Zhang <cherryyz@google.com> | 2020-04-21 19:54:37 -0400 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2020-04-22 14:57:26 +0000 |
commit | 245a2f5780ebc956a84964c25804b50f27c2d984 (patch) | |
tree | 86b292e1411c56fefa777c1fa69e95f572b86f32 /src/cmd/link/internal/ld/deadcode.go | |
parent | 9570fc8f7155a668c0e868d5757ac7b0774e8340 (diff) | |
download | go-245a2f5780ebc956a84964c25804b50f27c2d984.tar.gz go-245a2f5780ebc956a84964c25804b50f27c2d984.zip |
[dev.link] cmd/link: delete ctxt.Reachparent
It is no longer needed as we have converted the fieldtrack pass
to using the loader.
Also free loader.Reachparent after we are done with it.
Change-Id: Ibc4b29f282e1e4aea363a1b549755e31f84b0295
Reviewed-on: https://go-review.googlesource.com/c/go/+/229322
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Diffstat (limited to 'src/cmd/link/internal/ld/deadcode.go')
-rw-r--r-- | src/cmd/link/internal/ld/deadcode.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go index 26c468c7a5..bb74b9e70d 100644 --- a/src/cmd/link/internal/ld/deadcode.go +++ b/src/cmd/link/internal/ld/deadcode.go @@ -45,7 +45,7 @@ type deadcodePass struct { func (d *deadcodePass) init() { d.ldr.InitReachable() d.ifaceMethod = make(map[methodsig]bool) - if d.ctxt.Reachparent != nil { + if objabi.Fieldtrack_enabled != 0 { d.ldr.Reachparent = make([]loader.Sym, d.ldr.NSym()) } heap.Init(&d.wq) @@ -190,7 +190,7 @@ func (d *deadcodePass) mark(symIdx, parent loader.Sym) { if symIdx != 0 && !d.ldr.AttrReachable(symIdx) { d.wq.push(symIdx) d.ldr.SetAttrReachable(symIdx, true) - if d.ctxt.Reachparent != nil { + if objabi.Fieldtrack_enabled != 0 { d.ldr.Reachparent[symIdx] = parent } if *flagDumpDep { |