[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>
This commit is contained in:
Keith Randall 2020-11-28 15:53:32 -08:00
parent 617383377f
commit fea898a4b0
11 changed files with 66 additions and 56 deletions

View file

@ -675,7 +675,7 @@ func slicelit(ctxt initContext, n ir.Node, var_ ir.Node, init *ir.Nodes) {
init.Append(ir.Nod(ir.OVARDEF, x, nil))
}
a = ir.Nod(ir.OADDR, x, nil)
a = nodAddr(x)
} else if n.Esc() == EscNone {
a = temp(t)
if vstat == nil {
@ -687,7 +687,7 @@ func slicelit(ctxt initContext, n ir.Node, var_ ir.Node, init *ir.Nodes) {
init.Append(ir.Nod(ir.OVARDEF, a, nil))
}
a = ir.Nod(ir.OADDR, a, nil)
a = nodAddr(a)
} else {
a = ir.Nod(ir.ONEW, ir.TypeNode(t), nil)
}
@ -888,7 +888,7 @@ func anylit(n ir.Node, var_ ir.Node, init *ir.Nodes) {
if n.Right() != nil {
// n.Right is stack temporary used as backing store.
init.Append(ir.Nod(ir.OAS, n.Right(), nil)) // zero backing store, just in case (#18410)
r = ir.Nod(ir.OADDR, n.Right(), nil)
r = nodAddr(n.Right())
r = typecheck(r, ctxExpr)
} else {
r = ir.Nod(ir.ONEW, ir.TypeNode(n.Left().Type()), nil)