Skip to content

Commit 4ee4607

Browse files
cuonglmbradfitz
authored andcommitted
cmd/compile: use internal/race
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent c6f9321 commit 4ee4607

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

src/cmd/compile/internal/gc/norace.go

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/cmd/compile/internal/gc/pgen.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"cmd/internal/src"
1414
"cmd/internal/sys"
1515
"fmt"
16+
"internal/race"
1617
"math/rand"
1718
"sort"
1819
"sync"
@@ -325,7 +326,7 @@ func compileSSA(fn *Node, worker int) {
325326
}
326327

327328
func init() {
328-
if raceEnabled {
329+
if race.Enabled {
329330
rand.Seed(time.Now().UnixNano())
330331
}
331332
}
@@ -336,7 +337,7 @@ func init() {
336337
func compileFunctions() {
337338
if len(compilequeue) != 0 {
338339
sizeCalculationDisabled = true // not safe to calculate sizes concurrently
339-
if raceEnabled {
340+
if race.Enabled {
340341
// Randomize compilation order to try to shake out races.
341342
tmp := make([]*Node, len(compilequeue))
342343
perm := rand.Perm(len(compilequeue))

src/cmd/compile/internal/gc/race.go

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/cmd/dist/buildtool.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ var bootstrapDirs = []string{
9090
"debug/macho",
9191
"debug/pe",
9292
"internal/goversion",
93+
"internal/race",
9394
"internal/xcoff",
9495
"math/big",
9596
"math/bits",

0 commit comments

Comments
 (0)