]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: move racewalk comment to walk/race.go
authorAustin Clements <austin@google.com>
Fri, 7 Jul 2023 21:06:23 +0000 (17:06 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 21 Aug 2023 20:20:03 +0000 (20:20 +0000)
This comment got left behind in some refactoring and now refers to
code "below" that is no longer below. Move it to be with the code it's
referring to.

Change-Id: I7f7bf0cf8b22c1f6e05ff12b8be71d18fb3359d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/521177
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Austin Clements <austin@google.com>
TryBot-Bypass: Austin Clements <austin@google.com>

src/cmd/compile/internal/base/base.go
src/cmd/compile/internal/walk/race.go

index dd73e50c66b8d22526c6bc7674947af0f7049ce1..458481fa4edeaec9225f4f8611a459f2c52a2ce4 100644 (file)
@@ -232,26 +232,6 @@ func Compiling(pkgs []string) bool {
        return false
 }
 
-// The racewalk pass is currently handled in three parts.
-//
-// First, for flag_race, it inserts calls to racefuncenter and
-// racefuncexit at the start and end (respectively) of each
-// function. This is handled below.
-//
-// Second, during buildssa, it inserts appropriate instrumentation
-// calls immediately before each memory load or store. This is handled
-// by the (*state).instrument method in ssa.go, so here we just set
-// the Func.InstrumentBody flag as needed. For background on why this
-// is done during SSA construction rather than a separate SSA pass,
-// see issue #19054.
-//
-// Third, we remove calls to racefuncenter and racefuncexit, for leaf
-// functions without instrumented operations. This is done as part of
-// ssa opt pass via special rule.
-
-// TODO(dvyukov): do not instrument initialization as writes:
-// a := make([]int, 10)
-
 // Do not instrument the following packages at all,
 // at best instrumentation would cause infinite recursion.
 var NoInstrumentPkgs = []string{
index 859e5c57f06ff8ebb31d93fe8d84a5507abe7448..6384e162702afdde5dc1066ca57fe0406276048f 100644 (file)
@@ -11,6 +11,26 @@ import (
        "cmd/internal/src"
 )
 
+// The racewalk pass is currently handled in three parts.
+//
+// First, for flag_race, it inserts calls to racefuncenter and
+// racefuncexit at the start and end (respectively) of each
+// function. This is handled below.
+//
+// Second, during buildssa, it inserts appropriate instrumentation
+// calls immediately before each memory load or store. This is handled
+// by the (*state).instrument method in ssa.go, so here we just set
+// the Func.InstrumentBody flag as needed. For background on why this
+// is done during SSA construction rather than a separate SSA pass,
+// see issue #19054.
+//
+// Third, we remove calls to racefuncenter and racefuncexit, for leaf
+// functions without instrumented operations. This is done as part of
+// ssa opt pass via special rule.
+
+// TODO(dvyukov): do not instrument initialization as writes:
+// a := make([]int, 10)
+
 func instrument(fn *ir.Func) {
        if fn.Pragma&ir.Norace != 0 || (fn.Linksym() != nil && fn.Linksym().ABIWrapper()) {
                return