go/src/cmd/compile/internal/ir/node_gen.go
Russ Cox 4e8f1e139f [dev.regabi] cmd/compile: cleanup for concrete types - sinit
An automated rewrite will add concrete type assertions after
a test of n.Op(), when n can be safely type-asserted
(meaning, n is not reassigned a different type, n is not reassigned
and then used outside the scope of the type assertion,
and so on).

This sequence of CLs handles the code that the automated
rewrite does not: adding specific types to function arguments,
adjusting code not to call n.Left() etc when n may have multiple
representations, and so on.

This CL focuses on sinit.go.

Passes buildall w/ toolstash -cmp.

Change-Id: I3e9458e69a7a9b3f2fe139382bf961bc4473cc42
Reviewed-on: https://go-review.googlesource.com/c/go/+/277928
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>
2020-12-18 17:52:51 +00:00

1009 lines
25 KiB
Go

// Code generated by mknode.go. DO NOT EDIT.
package ir
import "fmt"
func (n *AddStringExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *AddStringExpr) copy() Node {
c := *n
c.init = c.init.Copy()
c.List_ = c.List_.Copy()
return &c
}
func (n *AddStringExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDoList(n.List_, err, do)
return err
}
func (n *AddStringExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
editList(n.List_, edit)
}
func (n *AddrExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *AddrExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *AddrExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
err = maybeDo(n.Alloc, err, do)
return err
}
func (n *AddrExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
n.Alloc = maybeEdit(n.Alloc, edit)
}
func (n *ArrayType) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *ArrayType) copy() Node {
c := *n
return &c
}
func (n *ArrayType) doChildren(do func(Node) error) error {
var err error
err = maybeDo(n.Len, err, do)
err = maybeDo(n.Elem, err, do)
return err
}
func (n *ArrayType) editChildren(edit func(Node) Node) {
n.Len = maybeEdit(n.Len, edit)
n.Elem = maybeEdit(n.Elem, edit)
}
func (n *AssignListStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *AssignListStmt) copy() Node {
c := *n
c.init = c.init.Copy()
c.Lhs = c.Lhs.Copy()
c.Rhs = c.Rhs.Copy()
return &c
}
func (n *AssignListStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDoList(n.Lhs, err, do)
err = maybeDoList(n.Rhs, err, do)
return err
}
func (n *AssignListStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
editList(n.Lhs, edit)
editList(n.Rhs, edit)
}
func (n *AssignOpStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *AssignOpStmt) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *AssignOpStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
err = maybeDo(n.Y, err, do)
return err
}
func (n *AssignOpStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
n.Y = maybeEdit(n.Y, edit)
}
func (n *AssignStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *AssignStmt) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *AssignStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
err = maybeDo(n.Y, err, do)
return err
}
func (n *AssignStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
n.Y = maybeEdit(n.Y, edit)
}
func (n *BinaryExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *BinaryExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *BinaryExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
err = maybeDo(n.Y, err, do)
return err
}
func (n *BinaryExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
n.Y = maybeEdit(n.Y, edit)
}
func (n *BlockStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *BlockStmt) copy() Node {
c := *n
c.init = c.init.Copy()
c.List_ = c.List_.Copy()
return &c
}
func (n *BlockStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDoList(n.List_, err, do)
return err
}
func (n *BlockStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
editList(n.List_, edit)
}
func (n *BranchStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *BranchStmt) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *BranchStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
return err
}
func (n *BranchStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
}
func (n *CallExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *CallExpr) copy() Node {
c := *n
c.init = c.init.Copy()
c.Args = c.Args.Copy()
c.Rargs = c.Rargs.Copy()
c.Body_ = c.Body_.Copy()
return &c
}
func (n *CallExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
err = maybeDoList(n.Args, err, do)
err = maybeDoList(n.Rargs, err, do)
err = maybeDoList(n.Body_, err, do)
return err
}
func (n *CallExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
editList(n.Args, edit)
editList(n.Rargs, edit)
editList(n.Body_, edit)
}
func (n *CallPartExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *CallPartExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *CallPartExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
return err
}
func (n *CallPartExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
}
func (n *CaseStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *CaseStmt) copy() Node {
c := *n
c.init = c.init.Copy()
c.Vars = c.Vars.Copy()
c.List_ = c.List_.Copy()
c.Body_ = c.Body_.Copy()
return &c
}
func (n *CaseStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDoList(n.Vars, err, do)
err = maybeDoList(n.List_, err, do)
err = maybeDo(n.Comm, err, do)
err = maybeDoList(n.Body_, err, do)
return err
}
func (n *CaseStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
editList(n.Vars, edit)
editList(n.List_, edit)
n.Comm = maybeEdit(n.Comm, edit)
editList(n.Body_, edit)
}
func (n *ChanType) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *ChanType) copy() Node {
c := *n
return &c
}
func (n *ChanType) doChildren(do func(Node) error) error {
var err error
err = maybeDo(n.Elem, err, do)
return err
}
func (n *ChanType) editChildren(edit func(Node) Node) {
n.Elem = maybeEdit(n.Elem, edit)
}
func (n *ClosureExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *ClosureExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *ClosureExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
return err
}
func (n *ClosureExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
}
func (n *ClosureReadExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *ClosureReadExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *ClosureReadExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
return err
}
func (n *ClosureReadExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
}
func (n *CompLitExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *CompLitExpr) copy() Node {
c := *n
c.init = c.init.Copy()
c.List_ = c.List_.Copy()
return &c
}
func (n *CompLitExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Ntype, err, do)
err = maybeDoList(n.List_, err, do)
return err
}
func (n *CompLitExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Ntype = toNtype(maybeEdit(n.Ntype, edit))
editList(n.List_, edit)
}
func (n *ConstExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *ConstExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *ConstExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
return err
}
func (n *ConstExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
}
func (n *ConvExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *ConvExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *ConvExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
return err
}
func (n *ConvExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
}
func (n *Decl) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *Decl) copy() Node {
c := *n
return &c
}
func (n *Decl) doChildren(do func(Node) error) error {
var err error
err = maybeDo(n.X, err, do)
return err
}
func (n *Decl) editChildren(edit func(Node) Node) {
n.X = maybeEdit(n.X, edit)
}
func (n *ForStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *ForStmt) copy() Node {
c := *n
c.init = c.init.Copy()
c.Late = c.Late.Copy()
c.Body_ = c.Body_.Copy()
return &c
}
func (n *ForStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Cond, err, do)
err = maybeDoList(n.Late, err, do)
err = maybeDo(n.Post, err, do)
err = maybeDoList(n.Body_, err, do)
return err
}
func (n *ForStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Cond = maybeEdit(n.Cond, edit)
editList(n.Late, edit)
n.Post = maybeEdit(n.Post, edit)
editList(n.Body_, edit)
}
func (n *Func) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *Func) copy() Node {
c := *n
c.Body_ = c.Body_.Copy()
return &c
}
func (n *Func) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.Body_, err, do)
return err
}
func (n *Func) editChildren(edit func(Node) Node) {
editList(n.Body_, edit)
}
func (n *FuncType) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *FuncType) copy() Node {
c := *n
if c.Recv != nil {
c.Recv = c.Recv.copy()
}
c.Params = copyFields(c.Params)
c.Results = copyFields(c.Results)
return &c
}
func (n *FuncType) doChildren(do func(Node) error) error {
var err error
err = maybeDoField(n.Recv, err, do)
err = maybeDoFields(n.Params, err, do)
err = maybeDoFields(n.Results, err, do)
return err
}
func (n *FuncType) editChildren(edit func(Node) Node) {
editField(n.Recv, edit)
editFields(n.Params, edit)
editFields(n.Results, edit)
}
func (n *GoDeferStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *GoDeferStmt) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *GoDeferStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Call, err, do)
return err
}
func (n *GoDeferStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Call = maybeEdit(n.Call, edit)
}
func (n *Ident) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *Ident) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *Ident) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
return err
}
func (n *Ident) editChildren(edit func(Node) Node) {
editList(n.init, edit)
}
func (n *IfStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *IfStmt) copy() Node {
c := *n
c.init = c.init.Copy()
c.Body_ = c.Body_.Copy()
c.Else = c.Else.Copy()
return &c
}
func (n *IfStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Cond, err, do)
err = maybeDoList(n.Body_, err, do)
err = maybeDoList(n.Else, err, do)
return err
}
func (n *IfStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Cond = maybeEdit(n.Cond, edit)
editList(n.Body_, edit)
editList(n.Else, edit)
}
func (n *IndexExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *IndexExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *IndexExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
err = maybeDo(n.Index, err, do)
return err
}
func (n *IndexExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
n.Index = maybeEdit(n.Index, edit)
}
func (n *InlineMarkStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *InlineMarkStmt) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *InlineMarkStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
return err
}
func (n *InlineMarkStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
}
func (n *InlinedCallExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *InlinedCallExpr) copy() Node {
c := *n
c.init = c.init.Copy()
c.Body_ = c.Body_.Copy()
c.ReturnVars = c.ReturnVars.Copy()
return &c
}
func (n *InlinedCallExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDoList(n.Body_, err, do)
err = maybeDoList(n.ReturnVars, err, do)
return err
}
func (n *InlinedCallExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
editList(n.Body_, edit)
editList(n.ReturnVars, edit)
}
func (n *InterfaceType) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *InterfaceType) copy() Node {
c := *n
c.Methods = copyFields(c.Methods)
return &c
}
func (n *InterfaceType) doChildren(do func(Node) error) error {
var err error
err = maybeDoFields(n.Methods, err, do)
return err
}
func (n *InterfaceType) editChildren(edit func(Node) Node) {
editFields(n.Methods, edit)
}
func (n *KeyExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *KeyExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *KeyExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Key, err, do)
err = maybeDo(n.Value, err, do)
return err
}
func (n *KeyExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Key = maybeEdit(n.Key, edit)
n.Value = maybeEdit(n.Value, edit)
}
func (n *LabelStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *LabelStmt) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *LabelStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
return err
}
func (n *LabelStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
}
func (n *LogicalExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *LogicalExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *LogicalExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
err = maybeDo(n.Y, err, do)
return err
}
func (n *LogicalExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
n.Y = maybeEdit(n.Y, edit)
}
func (n *MakeExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *MakeExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *MakeExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Len, err, do)
err = maybeDo(n.Cap, err, do)
return err
}
func (n *MakeExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Len = maybeEdit(n.Len, edit)
n.Cap = maybeEdit(n.Cap, edit)
}
func (n *MapType) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *MapType) copy() Node {
c := *n
return &c
}
func (n *MapType) doChildren(do func(Node) error) error {
var err error
err = maybeDo(n.Key, err, do)
err = maybeDo(n.Elem, err, do)
return err
}
func (n *MapType) editChildren(edit func(Node) Node) {
n.Key = maybeEdit(n.Key, edit)
n.Elem = maybeEdit(n.Elem, edit)
}
func (n *MethodExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *MethodExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *MethodExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X_Delete, err, do)
err = maybeDo(n.M_Delete, err, do)
return err
}
func (n *MethodExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X_Delete = maybeEdit(n.X_Delete, edit)
n.M_Delete = maybeEdit(n.M_Delete, edit)
}
func (n *Name) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *Name) copy() Node {
c := *n
return &c
}
func (n *Name) doChildren(do func(Node) error) error {
var err error
return err
}
func (n *Name) editChildren(edit func(Node) Node) {
}
func (n *NilExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *NilExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *NilExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
return err
}
func (n *NilExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
}
func (n *ParenExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *ParenExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *ParenExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
return err
}
func (n *ParenExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
}
func (n *PkgName) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *PkgName) copy() Node {
c := *n
return &c
}
func (n *PkgName) doChildren(do func(Node) error) error {
var err error
return err
}
func (n *PkgName) editChildren(edit func(Node) Node) {
}
func (n *RangeStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *RangeStmt) copy() Node {
c := *n
c.init = c.init.Copy()
c.Vars = c.Vars.Copy()
c.Body_ = c.Body_.Copy()
return &c
}
func (n *RangeStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDoList(n.Vars, err, do)
err = maybeDo(n.X, err, do)
err = maybeDoList(n.Body_, err, do)
return err
}
func (n *RangeStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
editList(n.Vars, edit)
n.X = maybeEdit(n.X, edit)
editList(n.Body_, edit)
}
func (n *ResultExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *ResultExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *ResultExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
return err
}
func (n *ResultExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
}
func (n *ReturnStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *ReturnStmt) copy() Node {
c := *n
c.init = c.init.Copy()
c.Results = c.Results.Copy()
return &c
}
func (n *ReturnStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDoList(n.Results, err, do)
return err
}
func (n *ReturnStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
editList(n.Results, edit)
}
func (n *SelectStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *SelectStmt) copy() Node {
c := *n
c.init = c.init.Copy()
c.Cases = c.Cases.Copy()
c.Compiled = c.Compiled.Copy()
return &c
}
func (n *SelectStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDoList(n.Cases, err, do)
err = maybeDoList(n.Compiled, err, do)
return err
}
func (n *SelectStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
editList(n.Cases, edit)
editList(n.Compiled, edit)
}
func (n *SelectorExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *SelectorExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *SelectorExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
return err
}
func (n *SelectorExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
}
func (n *SendStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *SendStmt) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *SendStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Chan, err, do)
err = maybeDo(n.Value, err, do)
return err
}
func (n *SendStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Chan = maybeEdit(n.Chan, edit)
n.Value = maybeEdit(n.Value, edit)
}
func (n *SliceExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *SliceExpr) copy() Node {
c := *n
c.init = c.init.Copy()
c.List_ = c.List_.Copy()
return &c
}
func (n *SliceExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
err = maybeDoList(n.List_, err, do)
return err
}
func (n *SliceExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
editList(n.List_, edit)
}
func (n *SliceHeaderExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *SliceHeaderExpr) copy() Node {
c := *n
c.init = c.init.Copy()
c.LenCap_ = c.LenCap_.Copy()
return &c
}
func (n *SliceHeaderExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Ptr, err, do)
err = maybeDoList(n.LenCap_, err, do)
return err
}
func (n *SliceHeaderExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Ptr = maybeEdit(n.Ptr, edit)
editList(n.LenCap_, edit)
}
func (n *SliceType) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *SliceType) copy() Node {
c := *n
return &c
}
func (n *SliceType) doChildren(do func(Node) error) error {
var err error
err = maybeDo(n.Elem, err, do)
return err
}
func (n *SliceType) editChildren(edit func(Node) Node) {
n.Elem = maybeEdit(n.Elem, edit)
}
func (n *StarExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *StarExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *StarExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
return err
}
func (n *StarExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
}
func (n *StructKeyExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *StructKeyExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *StructKeyExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Value, err, do)
return err
}
func (n *StructKeyExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Value = maybeEdit(n.Value, edit)
}
func (n *StructType) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *StructType) copy() Node {
c := *n
c.Fields = copyFields(c.Fields)
return &c
}
func (n *StructType) doChildren(do func(Node) error) error {
var err error
err = maybeDoFields(n.Fields, err, do)
return err
}
func (n *StructType) editChildren(edit func(Node) Node) {
editFields(n.Fields, edit)
}
func (n *SwitchStmt) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *SwitchStmt) copy() Node {
c := *n
c.init = c.init.Copy()
c.Cases = c.Cases.Copy()
c.Compiled = c.Compiled.Copy()
return &c
}
func (n *SwitchStmt) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.Tag, err, do)
err = maybeDoList(n.Cases, err, do)
err = maybeDoList(n.Compiled, err, do)
return err
}
func (n *SwitchStmt) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.Tag = maybeEdit(n.Tag, edit)
editList(n.Cases, edit)
editList(n.Compiled, edit)
}
func (n *TypeAssertExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *TypeAssertExpr) copy() Node {
c := *n
c.init = c.init.Copy()
c.Itab = c.Itab.Copy()
return &c
}
func (n *TypeAssertExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
err = maybeDo(n.Ntype, err, do)
err = maybeDoList(n.Itab, err, do)
return err
}
func (n *TypeAssertExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
n.Ntype = maybeEdit(n.Ntype, edit)
editList(n.Itab, edit)
}
func (n *TypeSwitchGuard) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *TypeSwitchGuard) copy() Node {
c := *n
return &c
}
func (n *TypeSwitchGuard) doChildren(do func(Node) error) error {
var err error
if n.Tag != nil {
err = maybeDo(n.Tag, err, do)
}
err = maybeDo(n.X, err, do)
return err
}
func (n *TypeSwitchGuard) editChildren(edit func(Node) Node) {
if n.Tag != nil {
n.Tag = edit(n.Tag).(*Ident)
}
n.X = maybeEdit(n.X, edit)
}
func (n *UnaryExpr) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *UnaryExpr) copy() Node {
c := *n
c.init = c.init.Copy()
return &c
}
func (n *UnaryExpr) doChildren(do func(Node) error) error {
var err error
err = maybeDoList(n.init, err, do)
err = maybeDo(n.X, err, do)
return err
}
func (n *UnaryExpr) editChildren(edit func(Node) Node) {
editList(n.init, edit)
n.X = maybeEdit(n.X, edit)
}
func (n *typeNode) Format(s fmt.State, verb rune) { FmtNode(n, s, verb) }
func (n *typeNode) copy() Node {
c := *n
return &c
}
func (n *typeNode) doChildren(do func(Node) error) error {
var err error
return err
}
func (n *typeNode) editChildren(edit func(Node) Node) {
}