diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2023-08-17 22:19:10 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-08-18 22:38:47 +0000 |
| commit | 78f90511ec89774fcdfe3d619972a58dd73b4954 (patch) | |
| tree | 5e368b298da156a3bc4aa943ad254ecacc5effee /src/cmd/compile/internal/reflectdata/alg.go | |
| parent | 2a0b8cfd801077359d4483801bd5ae3b3572b314 (diff) | |
| download | go-78f90511ec89774fcdfe3d619972a58dd73b4954.tar.xz | |
cmd/compile/internal/typecheck: replace Temp calls with TempAt
Steps towards eliminating implicit dependencies on base.Pos and
ir.CurFunc. Mechanical CL produced with gofmt -r.
Change-Id: I070015513cb955cbe87f9a148d81db8c0d4b0dc5
Reviewed-on: https://go-review.googlesource.com/c/go/+/520605
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/reflectdata/alg.go')
| -rw-r--r-- | src/cmd/compile/internal/reflectdata/alg.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/reflectdata/alg.go b/src/cmd/compile/internal/reflectdata/alg.go index edfd92fb40..27ecbe9380 100644 --- a/src/cmd/compile/internal/reflectdata/alg.go +++ b/src/cmd/compile/internal/reflectdata/alg.go @@ -165,7 +165,7 @@ func hashFunc(t *types.Type) *ir.Func { hashel := hashfor(t.Elem()) // for i := 0; i < nelem; i++ - ni := typecheck.Temp(types.Types[types.TINT]) + ni := typecheck.TempAt(base.Pos, ir.CurFunc, types.Types[types.TINT]) init := ir.NewAssignStmt(base.Pos, ni, ir.NewInt(base.Pos, 0)) cond := ir.NewBinaryExpr(base.Pos, ir.OLT, ni, ir.NewInt(base.Pos, t.NumElem())) post := ir.NewAssignStmt(base.Pos, ni, ir.NewBinaryExpr(base.Pos, ir.OADD, ni, ir.NewInt(base.Pos, 1))) @@ -442,7 +442,7 @@ func eqFunc(t *types.Type) *ir.Func { if iterateTo > 0 { // Generate an unrolled for loop. // for i := 0; i < nelem/unroll*unroll; i += unroll - i := typecheck.Temp(types.Types[types.TINT]) + i := typecheck.TempAt(base.Pos, ir.CurFunc, types.Types[types.TINT]) init := ir.NewAssignStmt(base.Pos, i, ir.NewInt(base.Pos, 0)) cond := ir.NewBinaryExpr(base.Pos, ir.OLT, i, ir.NewInt(base.Pos, iterateTo)) loop := ir.NewForStmt(base.Pos, nil, cond, nil, nil, false) |
