[dev.regabi] cmd/compile: add ONAMEOFFSET, delete to-be-deleted fields

Breaks toolstash but clearly no effect.

Change-Id: Ic05bb7f74db170f140cf3b3cd7d629f159e3aae1
Reviewed-on: https://go-review.googlesource.com/c/go/+/278913
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Russ Cox 2020-12-17 00:59:35 -05:00
parent 4e8f1e139f
commit c76be2a24e
4 changed files with 37 additions and 13 deletions

View file

@ -530,8 +530,6 @@ func (n *MakeExpr) SetOp(op Op) {
type MethodExpr struct {
miniExpr
T *types.Type
X_Delete Node
M_Delete Node // TODO(rsc): Delete (breaks toolstash b/c inlining costs go down)
Method *types.Field
FuncName_ *Name
}
@ -540,8 +538,6 @@ func NewMethodExpr(pos src.XPos, t *types.Type, method *types.Field) *MethodExpr
n := &MethodExpr{T: t, Method: method}
n.pos = pos
n.op = OMETHEXPR
n.X_Delete = TypeNode(t) // TODO(rsc): Delete.
n.M_Delete = NewNameAt(pos, method.Sym) // TODO(rsc): Delete.
return n
}
@ -619,6 +615,21 @@ func NewResultExpr(pos src.XPos, typ *types.Type, offset int64) *ResultExpr {
func (n *ResultExpr) Offset() int64 { return n.Offset_ }
func (n *ResultExpr) SetOffset(x int64) { n.Offset_ = x }
// A NameOffsetExpr refers to an offset within a variable.
// It is like a SelectorExpr but without the field name.
type NameOffsetExpr struct {
miniExpr
Name_ *Name
Offset_ int64
}
func NewNameOffsetExpr(pos src.XPos, name *Name, offset int64, typ *types.Type) *NameOffsetExpr {
n := &NameOffsetExpr{Name_: name, Offset_: offset}
n.typ = typ
n.op = ONAMEOFFSET
return n
}
// A SelectorExpr is a selector expression X.Sym.
type SelectorExpr struct {
miniExpr