mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: minor cleanup to HashDebugPos
HashDebugPos function/method included a parameter that was always the same, and a variable in the same package as the hashdebug code. So remove it. (I wrote that code, there was no reason for it to be that way). Also corrects a stale comment in the loopvar code. Change-Id: Id3da69cfe6dadeb31d5de62fb76d15103a5d6152 Reviewed-on: https://go-review.googlesource.com/c/go/+/482816 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
parent
46a49eb52e
commit
42866e566a
4 changed files with 11 additions and 8 deletions
|
|
@ -71,7 +71,7 @@ func ForCapture(fn *ir.Func) []*ir.Name {
|
|||
// subject to hash-variable debugging.
|
||||
maybeReplaceVar := func(k ir.Node, x *ir.RangeStmt) ir.Node {
|
||||
if n, ok := k.(*ir.Name); ok && possiblyLeaked[n] {
|
||||
if base.LoopVarHash.DebugHashMatchPos(base.Ctxt, n.Pos()) {
|
||||
if base.LoopVarHash.DebugHashMatchPos(n.Pos()) {
|
||||
// Rename the loop key, prefix body with assignment from loop key
|
||||
transformed = append(transformed, n)
|
||||
tk := typecheck.Temp(n.Type())
|
||||
|
|
@ -167,7 +167,7 @@ func ForCapture(fn *ir.Func) []*ir.Name {
|
|||
forAllDefInInit(x, func(z ir.Node) {
|
||||
if n, ok := z.(*ir.Name); ok && possiblyLeaked[n] {
|
||||
// Hash on n.Pos() for most precise failure location.
|
||||
if base.LoopVarHash.DebugHashMatchPos(base.Ctxt, n.Pos()) {
|
||||
if base.LoopVarHash.DebugHashMatchPos(n.Pos()) {
|
||||
leaked = append(leaked, n)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue