]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: changed variable name due to shadowing of package name min
authorSergey Slukin <sergeyslukin90@gmail.com>
Sat, 22 Mar 2025 18:15:18 +0000 (21:15 +0300)
committerKeith Randall <khr@golang.org>
Wed, 2 Apr 2025 18:25:15 +0000 (11:25 -0700)
Change-Id: I52e5de04d137238d6f6779edcc662f5c7433c61e
Reviewed-on: https://go-review.googlesource.com/c/go/+/660195
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/compile/internal/ir/scc.go

index b6056040f7ba901d813e374fd10c30dace674887..7beacc78498a77cde917ebc6be603bb0e4b554c4 100644 (file)
@@ -22,7 +22,7 @@ package ir
 // Second, each function becomes two virtual nodes in the graph,
 // with numbers n and n+1. We record the function's node number as n
 // but search from node n+1. If the search tells us that the component
-// number (min) is n+1, we know that this is a trivial component: one function
+// number (minVisitGen) is n+1, we know that this is a trivial component: one function
 // plus its closures. If the search tells us that the component number is
 // n, then there was a path from node n+1 back to node n, meaning that
 // the function set is mutually recursive. The escape analysis can be
@@ -70,13 +70,13 @@ func (v *bottomUpVisitor) visit(n *Func) uint32 {
        id := v.visitgen
        v.nodeID[n] = id
        v.visitgen++
-       min := v.visitgen
+       minVisitGen := v.visitgen
        v.stack = append(v.stack, n)
 
        do := func(defn Node) {
                if defn != nil {
-                       if m := v.visit(defn.(*Func)); m < min {
-                               min = m
+                       if m := v.visit(defn.(*Func)); m < minVisitGen {
+                               minVisitGen = m
                        }
                }
        }
@@ -97,13 +97,13 @@ func (v *bottomUpVisitor) visit(n *Func) uint32 {
                }
        })
 
-       if (min == id || min == id+1) && !n.IsClosure() {
+       if (minVisitGen == id || minVisitGen == id+1) && !n.IsClosure() {
                // This node is the root of a strongly connected component.
 
-               // The original min was id+1. If the bottomUpVisitor found its way
+               // The original minVisitGen was id+1. If the bottomUpVisitor found its way
                // back to id, then this block is a set of mutually recursive functions.
                // Otherwise, it's just a lone function that does not recurse.
-               recursive := min == id
+               recursive := minVisitGen == id
 
                // Remove connected component from stack and mark v.nodeID so that future
                // visits return a large number, which will not affect the caller's min.
@@ -121,5 +121,5 @@ func (v *bottomUpVisitor) visit(n *Func) uint32 {
                v.analyze(block, recursive)
        }
 
-       return min
+       return minVisitGen
 }