mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: omit X:framepointer in compile version
Framepointer is the default now. Only print an X: list if the settings are _not_ the default. Before: $ go tool compile -V compile version devel +a5f30d9508 Sun Jul 16 14:43:48 2017 -0400 X:framepointer $ go1.8 tool compile -V compile version go1.8 X:framepointer $ After: $ go tool compile -V compile version devel +a5f30d9508 Sun Jul 16 14:43:48 2017 -0400 $ go1.9 tool compile -V # imagined compile version go1.9 $ Perpetuates #18317. Change-Id: I981ba5c62be32e650a166fc9740703122595639b Reviewed-on: https://go-review.googlesource.com/49252 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
8bb88fdcc2
commit
f0cf740733
3 changed files with 12 additions and 3 deletions
|
|
@ -104,7 +104,7 @@ func hidePanic() {
|
||||||
|
|
||||||
func doversion() {
|
func doversion() {
|
||||||
p := objabi.Expstring()
|
p := objabi.Expstring()
|
||||||
if p == "X:none" {
|
if p == objabi.DefaultExpstring() {
|
||||||
p = ""
|
p = ""
|
||||||
}
|
}
|
||||||
sep := ""
|
sep := ""
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ func Getgoextlinkenabled() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
framepointer_enabled = 1 // default
|
|
||||||
for _, f := range strings.Split(goexperiment, ",") {
|
for _, f := range strings.Split(goexperiment, ",") {
|
||||||
if f != "" {
|
if f != "" {
|
||||||
addexp(f)
|
addexp(f)
|
||||||
|
|
@ -80,7 +79,7 @@ func addexp(s string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
framepointer_enabled int
|
framepointer_enabled int = 1
|
||||||
Fieldtrack_enabled int
|
Fieldtrack_enabled int
|
||||||
Preemptibleloops_enabled int
|
Preemptibleloops_enabled int
|
||||||
Clobberdead_enabled int
|
Clobberdead_enabled int
|
||||||
|
|
@ -100,6 +99,12 @@ var exper = []struct {
|
||||||
{"clobberdead", &Clobberdead_enabled},
|
{"clobberdead", &Clobberdead_enabled},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var defaultExpstring = Expstring()
|
||||||
|
|
||||||
|
func DefaultExpstring() string {
|
||||||
|
return defaultExpstring
|
||||||
|
}
|
||||||
|
|
||||||
func Expstring() string {
|
func Expstring() string {
|
||||||
buf := "X"
|
buf := "X"
|
||||||
for i := range exper {
|
for i := range exper {
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,10 @@ func main() {
|
||||||
goarch = runtime.GOARCH
|
goarch = runtime.GOARCH
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Frame pointer is on by default now.
|
||||||
|
// golang.org/issue/18317.
|
||||||
|
return
|
||||||
|
|
||||||
version, err := exec.Command("go", "tool", "compile", "-V").Output()
|
version, err := exec.Command("go", "tool", "compile", "-V").Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
bug()
|
bug()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue