CL 14870 added internal/race to factor out duplicated race thunks,
we should use it.
No signification changes in compile time and compile binary size.
Change-Id: I786af44dd5bb0f4ab6709432eeb603f27a5b6c63
Reviewed-on: https://go-review.googlesource.com/c/go/+/178118
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
+++ /dev/null
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build !race
-
-package gc
-
-const raceEnabled = false
"cmd/internal/src"
"cmd/internal/sys"
"fmt"
+ "internal/race"
"math/rand"
"sort"
"sync"
}
func init() {
- if raceEnabled {
+ if race.Enabled {
rand.Seed(time.Now().UnixNano())
}
}
func compileFunctions() {
if len(compilequeue) != 0 {
sizeCalculationDisabled = true // not safe to calculate sizes concurrently
- if raceEnabled {
+ if race.Enabled {
// Randomize compilation order to try to shake out races.
tmp := make([]*Node, len(compilequeue))
perm := rand.Perm(len(compilequeue))
+++ /dev/null
-// Copyright 2017 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build race
-
-package gc
-
-const raceEnabled = true
"debug/macho",
"debug/pe",
"internal/goversion",
+ "internal/race",
"internal/xcoff",
"math/big",
"math/bits",