[dev.regabi] cmd/compile: export all Node fields [generated]

The plan was always to export them once we remove the getters
and setters, but do it a bit early, with _ suffixes as needed, so that
the reflection-based ir.Dump can access the fields.

Passes buildall w/ toolstash -cmp.

[git-generate]
cd src/cmd/compile/internal/ir
rf '
	mv AddStringExpr.list AddStringExpr.List_
	mv BlockStmt.list BlockStmt.List_
	mv CallExpr.body CallExpr.Body_
	mv CaseStmt.list CaseStmt.List_
	mv CaseStmt.body CaseStmt.Body_
	mv ClosureExpr.fn ClosureExpr.Func_
	mv CompLitExpr.list CompLitExpr.List_
	mv ForStmt.body ForStmt.Body_
	mv Func.body Func.Body_
	mv IfStmt.body IfStmt.Body_
	mv InlinedCallExpr.body InlinedCallExpr.Body_
	mv RangeStmt.body RangeStmt.Body_
	mv SliceExpr.list SliceExpr.List_
	mv SliceHeaderExpr.lenCap SliceHeaderExpr.LenCap_
	mv TypeSwitchGuard.name TypeSwitchGuard.Name_
'
go generate

Change-Id: I06e65920cecbcc51bea2254f52fcd7d5c5d0dc90
Reviewed-on: https://go-review.googlesource.com/c/go/+/275784
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Russ Cox 2020-12-06 15:36:58 -05:00
parent 2de0af3b1b
commit 6d783e7440
4 changed files with 128 additions and 128 deletions

View file

@ -49,9 +49,9 @@ import (
// pointer from the Func back to the OCALLPART.
type Func struct {
miniNode
typ *types.Type
body Nodes
iota int64
typ *types.Type
Body_ Nodes
iota int64
Nname *Name // ONAME node
OClosure *ClosureExpr // OCLOSURE node
@ -117,9 +117,9 @@ func NewFunc(pos src.XPos) *Func {
func (f *Func) isStmt() {}
func (f *Func) Func() *Func { return f }
func (f *Func) Body() Nodes { return f.body }
func (f *Func) PtrBody() *Nodes { return &f.body }
func (f *Func) SetBody(x Nodes) { f.body = x }
func (f *Func) Body() Nodes { return f.Body_ }
func (f *Func) PtrBody() *Nodes { return &f.Body_ }
func (f *Func) SetBody(x Nodes) { f.Body_ = x }
func (f *Func) Type() *types.Type { return f.typ }
func (f *Func) SetType(x *types.Type) { f.typ = x }
func (f *Func) Iota() int64 { return f.iota }