cmd/compile: add ability to print extra information in bisect output

Change-Id: I619c21ab9754f67b69215cfed238a3e489c7fbcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/493955
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
This commit is contained in:
Russ Cox 2023-05-09 12:09:45 -04:00
parent 3d33532d1c
commit 1099644f52
5 changed files with 45 additions and 41 deletions

View file

@ -91,7 +91,7 @@ func ForCapture(fn *ir.Func) []VarAndLoop {
// 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.MatchPos(n.Pos()) {
if base.LoopVarHash.MatchPos(n.Pos(), nil) {
// Rename the loop key, prefix body with assignment from loop key
transformed = append(transformed, VarAndLoop{n, x, lastPos})
tk := typecheck.Temp(n.Type())
@ -199,7 +199,7 @@ func ForCapture(fn *ir.Func) []VarAndLoop {
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.MatchPos(n.Pos()) {
if base.LoopVarHash.MatchPos(n.Pos(), nil) {
leaked = append(leaked, n)
}
}