1
0
mirror of https://github.com/golang/go synced 2024-11-23 18:00:06 -07:00

[dev.unified] cmd/compile/internal/noder: prefer *At functions

Unified IR tries to avoid depending on base.Pos, so we should prefer
explicit position arguments wherever possible.

Change-Id: I7163b1b8c5244fe7c2a7989e6a3f459a21a23e81
Reviewed-on: https://go-review.googlesource.com/c/go/+/418096
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Matthew Dempsky 2022-07-18 12:15:09 -07:00
parent 055a5e55fa
commit 76a82f09d6

View File

@ -1525,7 +1525,7 @@ func (r *reader) switchStmt(label *types.Sym) ir.Node {
for len(rtypes) < i {
rtypes = append(rtypes, nil)
}
rtypes = append(rtypes, reflectdata.TypePtr(typ))
rtypes = append(rtypes, reflectdata.TypePtrAt(cas.Pos(), typ))
}
}
}
@ -1976,7 +1976,7 @@ func (r *reader) exprType(nilOK bool) ir.Node {
setBasePos(pos)
lsymPtr := func(lsym *obj.LSym) ir.Node {
return typecheck.Expr(typecheck.NodAddr(ir.NewLinksymExpr(pos, lsym, types.Types[types.TUINT8])))
return typecheck.Expr(typecheck.NodAddrAt(pos, ir.NewLinksymExpr(pos, lsym, types.Types[types.TUINT8])))
}
var typ *types.Type