diff options
author | Russ Cox <rsc@golang.org> | 2021-04-15 23:05:49 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2021-04-16 19:20:53 +0000 |
commit | 95ed5c3800a87ddf9b0ec3958eaaa1a969306293 (patch) | |
tree | cb0c555f10ab706a5c491cbe48dd36da16658a1e /src/cmd/link/internal/ld/deadcode.go | |
parent | 2fc0ebb623e2859094ad3f41e61325df0c2163f8 (diff) | |
download | go-95ed5c3800a87ddf9b0ec3958eaaa1a969306293.tar.gz go-95ed5c3800a87ddf9b0ec3958eaaa1a969306293.zip |
internal/buildcfg: move build configuration out of cmd/internal/objabi
The go/build package needs access to this configuration,
so move it into a new package available to the standard library.
Change-Id: I868a94148b52350c76116451f4ad9191246adcff
Reviewed-on: https://go-review.googlesource.com/c/go/+/310731
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/link/internal/ld/deadcode.go')
-rw-r--r-- | src/cmd/link/internal/ld/deadcode.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go index 741a72cad8..1ed5598c99 100644 --- a/src/cmd/link/internal/ld/deadcode.go +++ b/src/cmd/link/internal/ld/deadcode.go @@ -11,6 +11,7 @@ import ( "cmd/link/internal/loader" "cmd/link/internal/sym" "fmt" + "internal/buildcfg" "unicode" ) @@ -32,7 +33,7 @@ type deadcodePass struct { func (d *deadcodePass) init() { d.ldr.InitReachable() d.ifaceMethod = make(map[methodsig]bool) - if objabi.Experiment.FieldTrack { + if buildcfg.Experiment.FieldTrack { d.ldr.Reachparent = make([]loader.Sym, d.ldr.NSym()) } d.dynlink = d.ctxt.DynlinkingGo() @@ -258,7 +259,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 objabi.Experiment.FieldTrack && d.ldr.Reachparent[symIdx] == 0 { + if buildcfg.Experiment.FieldTrack && d.ldr.Reachparent[symIdx] == 0 { d.ldr.Reachparent[symIdx] = parent } if *flagDumpDep { |