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>
This commit is contained in:
Matthew Dempsky 2023-08-17 22:19:10 -07:00 committed by Gopher Robot
parent 2a0b8cfd80
commit 78f90511ec
15 changed files with 61 additions and 69 deletions

View file

@ -459,7 +459,7 @@ func safeExpr(n ir.Node, init *ir.Nodes) ir.Node {
}
func copyExpr(n ir.Node, t *types.Type, init *ir.Nodes) ir.Node {
l := typecheck.Temp(t)
l := typecheck.TempAt(base.Pos, ir.CurFunc, t)
appendWalkStmt(init, ir.NewAssignStmt(base.Pos, l, n))
return l
}
@ -618,7 +618,7 @@ func walkCall1(n *ir.CallExpr, init *ir.Nodes) {
// to prevent that calls from clobbering arguments already on the stack.
if mayCall(arg) {
// assignment of arg to Temp
tmp := typecheck.Temp(param.Type)
tmp := typecheck.TempAt(base.Pos, ir.CurFunc, param.Type)
init.Append(convas(typecheck.Stmt(ir.NewAssignStmt(base.Pos, tmp, arg)).(*ir.AssignStmt), init))
// replace arg with temp
args[i] = tmp