summaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/alg.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2020-11-28 15:53:32 -0800
committerKeith Randall <khr@golang.org>2020-12-14 23:35:06 +0000
commitfea898a4b0f02cee08ea978eb5ce541a85783690 (patch)
tree7751feb86514efa78c10e26a799ece8633211783 /src/cmd/compile/internal/gc/alg.go
parent617383377f0e870a9258230cf29fd11097b9229a (diff)
downloadgo-git-fea898a4b0f02cee08ea978eb5ce541a85783690.tar.gz
[dev.regabi] cmd/compile: intercept the making of OADDR nodes
This is a mechanical change to intercept the construction of all OADDR nodes. We will use the new nodAddr and nodAddrAt functions to compute the Addrtaken bit. Change-Id: I90ee3acb8e32540a198a9999284573418729f422 Reviewed-on: https://go-review.googlesource.com/c/go/+/275694 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Keith Randall <khr@golang.org> Trust: Dan Scales <danscales@google.com> Reviewed-by: Dan Scales <danscales@google.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/alg.go')
-rw-r--r--src/cmd/compile/internal/gc/alg.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/gc/alg.go b/src/cmd/compile/internal/gc/alg.go
index ea57e7398d..7540944201 100644
--- a/src/cmd/compile/internal/gc/alg.go
+++ b/src/cmd/compile/internal/gc/alg.go
@@ -323,7 +323,7 @@ func genhash(t *types.Type) *obj.LSym {
nx := ir.Nod(ir.OINDEX, np, ni)
nx.SetBounded(true)
- na := ir.Nod(ir.OADDR, nx, nil)
+ na := nodAddr(nx)
call.PtrList().Append(na)
call.PtrList().Append(nh)
loop.PtrBody().Append(ir.Nod(ir.OAS, nh, call))
@@ -347,7 +347,7 @@ func genhash(t *types.Type) *obj.LSym {
hashel := hashfor(f.Type)
call := ir.Nod(ir.OCALL, hashel, nil)
nx := nodSym(ir.OXDOT, np, f.Sym) // TODO: fields from other packages?
- na := ir.Nod(ir.OADDR, nx, nil)
+ na := nodAddr(nx)
call.PtrList().Append(na)
call.PtrList().Append(nh)
fn.PtrBody().Append(ir.Nod(ir.OAS, nh, call))
@@ -362,7 +362,7 @@ func genhash(t *types.Type) *obj.LSym {
hashel := hashmem(f.Type)
call := ir.Nod(ir.OCALL, hashel, nil)
nx := nodSym(ir.OXDOT, np, f.Sym) // TODO: fields from other packages?
- na := ir.Nod(ir.OADDR, nx, nil)
+ na := nodAddr(nx)
call.PtrList().Append(na)
call.PtrList().Append(nh)
call.PtrList().Append(nodintconst(size))
@@ -868,8 +868,8 @@ func eqinterface(s, t ir.Node) (eqtab, eqdata ir.Node) {
// eqmem returns the node
// memequal(&p.field, &q.field [, size])
func eqmem(p ir.Node, q ir.Node, field *types.Sym, size int64) ir.Node {
- nx := ir.Nod(ir.OADDR, nodSym(ir.OXDOT, p, field), nil)
- ny := ir.Nod(ir.OADDR, nodSym(ir.OXDOT, q, field), nil)
+ nx := nodAddr(nodSym(ir.OXDOT, p, field))
+ ny := nodAddr(nodSym(ir.OXDOT, q, field))
nx = typecheck(nx, ctxExpr)
ny = typecheck(ny, ctxExpr)