1
0
mirror of https://github.com/golang/go synced 2024-11-17 20:54:48 -07:00

cmd/compile: gofmt -w -s

Change-Id: I4dad103d23121a21b04800ec157487fdf79f89a6
Reviewed-on: https://go-review.googlesource.com/c/go/+/424398
Run-TryBot: hopehook <hopehook@qq.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
hopehook 2022-08-17 17:02:06 +08:00 committed by Gopher Robot
parent 9c2b481b57
commit 87d6a9ff92
2 changed files with 19 additions and 11 deletions

View File

@ -32,8 +32,11 @@ var hd HashDebug
// DebugHashMatch reports whether environment variable GOSSAHASH
//
// 1. is empty (this is a special more-quickly implemented case of 3)
//
// 2. is "y" or "Y"
//
// 3. is a suffix of the sha1 hash of name
//
// 4. OR
// if evname(i) is a suffix of the sha1 hash of name
// where evname(i)=fmt.Sprintf("GOSSAHASH%d", i),
@ -55,8 +58,10 @@ var hd HashDebug
// Typical use:
//
// 1. you make a change to the compiler, say, adding a new phase
//
// 2. it is broken in some mystifying way, for example, make.bash builds a broken
// compiler that almost works, but crashes compiling a test in run.bash.
//
// 3. add this guard to the code, which by default leaves it broken, but
// does not run the broken new code if GOSSAHASH is non-empty and non-matching:
//
@ -66,6 +71,7 @@ var hd HashDebug
//
// 4. rebuild w/o the bad code, GOSSAHASH=n ./all.bash to verify that you
// put theguard in the right place with the right sense of the test.
//
// 5. use github.com/dr2chase/gossahash to search for the error:
//
// go install github.com/dr2chase/gossahash@latest
@ -73,9 +79,9 @@ var hd HashDebug
// gossahash -- <the thing that fails>
//
// for example: GOMAXPROCS=1 gossahash -- ./all.bash
//
// 6. gossahash should return a single function whose miscompilation
// causes the problem, and you can focus on that.
//
func DebugHashMatch(pkgAndName string) bool {
return hd.DebugHashMatch(pkgAndName)
}

View File

@ -809,7 +809,9 @@ func (f *Func) invalidateCFG() {
}
// DebugHashMatch returns
//
// base.DebugHashMatch(this function's package.name)
//
// for use in bug isolation. The return value is true unless
// environment variable GOSSAHASH is set, in which case "it depends".
// See [base.DebugHashMatch] for more information.