mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
cmd/compile: changed variable name due to shadowing of package name min
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>
This commit is contained in:
parent
144d4e5d5f
commit
116b82354c
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user