]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: gofmt -w -s
authorhopehook <hopehook.com@gmail.com>
Wed, 17 Aug 2022 09:02:06 +0000 (17:02 +0800)
committerGopher Robot <gobot@golang.org>
Wed, 17 Aug 2022 23:18:21 +0000 (23:18 +0000)
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>

src/cmd/compile/internal/base/hashdebug.go
src/cmd/compile/internal/ssa/func.go

index ca2e8a2420888f2a770008b8cad020e71ccdaf50..0a8e88f26ca118efa1e331505e4c10c3cc3e7426 100644 (file)
@@ -32,12 +32,15 @@ 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),
-//      for 0<=i<n such that for all i evname(i) != "" and evname(n) == ""
+//     if evname(i) is a suffix of the sha1 hash of name
+//     where evname(i)=fmt.Sprintf("GOSSAHASH%d", i),
+//     for 0<=i<n such that for all i evname(i) != "" and evname(n) == ""
 //
 //     That is, as long as they're not empty, try GOSSAHASH, GOSSAHASH0, GOSSAHASH1, etc,
 //     but quit trying at the first empty environment variable substitution.
@@ -55,27 +58,30 @@ 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:
 //
-//      if !base.DebugHashMatch(ir.PkgFuncName(fn)) {
-//      return nil // early exit, do nothing
-//      }
+//     if !base.DebugHashMatch(ir.PkgFuncName(fn)) {
+//     return nil // early exit, do nothing
+//     }
 //
 //  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
+//     go install github.com/dr2chase/gossahash@latest
 //
-//      gossahash -- <the thing that fails>
+//     gossahash -- <the thing that fails>
+//
+//     for example: GOMAXPROCS=1 gossahash -- ./all.bash
 //
-//      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)
 }
index d572b02c5ffa4657b23432a06f7856132ef909e5..a8eb74efdbef13ffa192ada9f0c89e72fc396590 100644 (file)
@@ -809,7 +809,9 @@ func (f *Func) invalidateCFG() {
 }
 
 // DebugHashMatch returns
-//   base.DebugHashMatch(this function's package.name)
+//
+//     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.