diff options
| author | Austin Clements <austin@google.com> | 2021-04-14 12:35:00 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2021-04-16 03:16:11 +0000 |
| commit | cf2396c70e7213570c69ca155203c25c960cc10c (patch) | |
| tree | e12465a560175aea167d35188767ad6a3b161cae /src/cmd | |
| parent | f08c552dabf4a75739e0f198804ae14368d31105 (diff) | |
| download | go-cf2396c70e7213570c69ca155203c25c960cc10c.tar.xz | |
internal/goexperiment: move baseline configuration to objabi
We need to adjust baseline experiment configuration based on the
configured GOOS and GOARCH, so it can't live in goexperiment. Move it
to objabi.
Change-Id: I65f4ce56902c6c1a82735050773c58f2d1320cc6
Reviewed-on: https://go-review.googlesource.com/c/go/+/310169
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/internal/objabi/exp.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/internal/objabi/exp.go b/src/cmd/internal/objabi/exp.go index 5ebbdac772..9eb3e431b3 100644 --- a/src/cmd/internal/objabi/exp.go +++ b/src/cmd/internal/objabi/exp.go @@ -20,6 +20,11 @@ import ( // was built with.) var Experiment goexperiment.Flags = parseExperiments() +// experimentBaseline specifies the experiment flags that are enabled by +// default in the current toolchain. This is, in effect, the "control" +// configuration and any variation from this is an experiment. +var experimentBaseline goexperiment.Flags + // FramePointerEnabled enables the use of platform conventions for // saving frame pointers. // @@ -31,7 +36,7 @@ var FramePointerEnabled = GOARCH == "amd64" || GOARCH == "arm64" func parseExperiments() goexperiment.Flags { // Start with the statically enabled set of experiments. - flags := goexperiment.BaselineFlags + flags := experimentBaseline // Pick up any changes to the baseline configuration from the // GOEXPERIMENT environment. This can be set at make.bash time @@ -135,7 +140,7 @@ func expList(exp, base *goexperiment.Flags) []string { // GOEXPERIMENT is exactly what a user would set on the command line // to get the set of enabled experiments. func GOEXPERIMENT() string { - return strings.Join(expList(&Experiment, &goexperiment.BaselineFlags), ",") + return strings.Join(expList(&Experiment, &experimentBaseline), ",") } // EnabledExperiments returns a list of enabled experiments, as |
