internal/goexperiment reports what GOEXPERIMENT the compiler itself was
compiled with, not what experiment to use for the object code that the
compiler is compiling.
Fixes #64189
Change-Id: I892d78611f8c76376032fd7459e755380afafac6
Reviewed-on: https://go-review.googlesource.com/c/go/+/542995
Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
"cmd/compile/internal/types"
"encoding/json"
"fmt"
- "internal/goexperiment"
+ "internal/buildcfg"
"io"
"os"
"path/filepath"
}
func Enabled() bool {
- return goexperiment.NewInliner || UnitTesting()
+ return buildcfg.Experiment.NewInliner || UnitTesting()
}
func UnitTesting() bool {
import (
"internal/buildcfg"
- "internal/goexperiment"
"internal/pkgbits"
"io"
if inl := name.Func.Inl; w.Bool(inl != nil) {
w.Len(int(inl.Cost))
w.Bool(inl.CanDelayResults)
- if goexperiment.NewInliner {
+ if buildcfg.Experiment.NewInliner {
w.String(inl.Properties)
}
}
"fmt"
"go/constant"
"internal/buildcfg"
- "internal/goexperiment"
"internal/pkgbits"
"path/filepath"
"strings"
Cost: int32(r.Len()),
CanDelayResults: r.Bool(),
}
- if goexperiment.NewInliner {
+ if buildcfg.Experiment.NewInliner {
fn.Inl.Properties = r.String()
}
}