diff --git a/src/cmd/compile/internal/ir/expr.go b/src/cmd/compile/internal/ir/expr.go index bb32d96088b..a989ce5e01a 100644 --- a/src/cmd/compile/internal/ir/expr.go +++ b/src/cmd/compile/internal/ir/expr.go @@ -106,8 +106,8 @@ func NewAddStringExpr(pos src.XPos, list []Node) *AddStringExpr { // It may end up being a normal address-of or an allocation of a composite literal. type AddrExpr struct { miniExpr - X Node - Alloc *Name // preallocated storage if any + X Node + Prealloc *Name // preallocated storage if any } func NewAddrExpr(pos src.XPos, x Node) *AddrExpr { diff --git a/src/cmd/compile/internal/ir/node_gen.go b/src/cmd/compile/internal/ir/node_gen.go index 6c1a28022f3..0dd5100018d 100644 --- a/src/cmd/compile/internal/ir/node_gen.go +++ b/src/cmd/compile/internal/ir/node_gen.go @@ -38,16 +38,16 @@ func (n *AddrExpr) doChildren(do func(Node) error) error { var err error err = maybeDoList(n.init, err, do) err = maybeDo(n.X, err, do) - if n.Alloc != nil { - err = maybeDo(n.Alloc, err, do) + if n.Prealloc != nil { + err = maybeDo(n.Prealloc, err, do) } return err } func (n *AddrExpr) editChildren(edit func(Node) Node) { editList(n.init, edit) n.X = maybeEdit(n.X, edit) - if n.Alloc != nil { - n.Alloc = edit(n.Alloc).(*Name) + if n.Prealloc != nil { + n.Prealloc = edit(n.Prealloc).(*Name) } } diff --git a/src/cmd/compile/internal/walk/closure.go b/src/cmd/compile/internal/walk/closure.go index 00d3f50bc4c..0726d3b5521 100644 --- a/src/cmd/compile/internal/walk/closure.go +++ b/src/cmd/compile/internal/walk/closure.go @@ -144,7 +144,7 @@ func walkClosure(clo *ir.ClosureExpr, init *ir.Nodes) ir.Node { if !types.Identical(typ, x.Type()) { panic("closure type does not match order's assigned type") } - addr.Alloc = x + addr.Prealloc = x clo.Prealloc = nil } @@ -189,7 +189,7 @@ func walkCallPart(n *ir.SelectorExpr, init *ir.Nodes) ir.Node { if !types.Identical(typ, x.Type()) { panic("partial call type does not match order's assigned type") } - addr.Alloc = x + addr.Prealloc = x n.Prealloc = nil } diff --git a/src/cmd/compile/internal/walk/complit.go b/src/cmd/compile/internal/walk/complit.go index 3c28ed70ade..d8605d39bdc 100644 --- a/src/cmd/compile/internal/walk/complit.go +++ b/src/cmd/compile/internal/walk/complit.go @@ -549,10 +549,10 @@ func anylit(n ir.Node, var_ ir.Node, init *ir.Nodes) { } var r ir.Node - if n.Alloc != nil { + if n.Prealloc != nil { // n.Right is stack temporary used as backing store. - appendWalkStmt(init, ir.NewAssignStmt(base.Pos, n.Alloc, nil)) // zero backing store, just in case (#18410) - r = typecheck.NodAddr(n.Alloc) + appendWalkStmt(init, ir.NewAssignStmt(base.Pos, n.Prealloc, nil)) // zero backing store, just in case (#18410) + r = typecheck.NodAddr(n.Prealloc) } else { r = ir.NewUnaryExpr(base.Pos, ir.ONEW, ir.TypeNode(n.X.Type())) r.SetEsc(n.Esc())