1
0
mirror of https://github.com/golang/go synced 2024-09-28 18:14:29 -06:00

cmd/compile: use internal/buildcfg for checking newinliner enable

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>
This commit is contained in:
Cuong Manh Le 2023-11-16 22:19:37 +07:00 committed by Gopher Robot
parent b9a08f159d
commit 5b6d3dea87
3 changed files with 4 additions and 6 deletions

View File

@ -10,7 +10,7 @@ import (
"cmd/compile/internal/types"
"encoding/json"
"fmt"
"internal/goexperiment"
"internal/buildcfg"
"io"
"os"
"path/filepath"
@ -213,7 +213,7 @@ func fnFileLine(fn *ir.Func) (string, uint) {
}
func Enabled() bool {
return goexperiment.NewInliner || UnitTesting()
return buildcfg.Experiment.NewInliner || UnitTesting()
}
func UnitTesting() bool {

View File

@ -6,7 +6,6 @@ package noder
import (
"internal/buildcfg"
"internal/goexperiment"
"internal/pkgbits"
"io"
@ -297,7 +296,7 @@ func (l *linker) relocFuncExt(w *pkgbits.Encoder, name *ir.Name) {
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)
}
}

View File

@ -8,7 +8,6 @@ import (
"fmt"
"go/constant"
"internal/buildcfg"
"internal/goexperiment"
"internal/pkgbits"
"path/filepath"
"strings"
@ -1103,7 +1102,7 @@ func (r *reader) funcExt(name *ir.Name, method *types.Sym) {
Cost: int32(r.Len()),
CanDelayResults: r.Bool(),
}
if goexperiment.NewInliner {
if buildcfg.Experiment.NewInliner {
fn.Inl.Properties = r.String()
}
}