mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: move Node.Initorder to flags
Grand savings: 6 bits. Change-Id: I364be54cc41534689e01672ed0fe2c10a560d3d4 Reviewed-on: https://go-review.googlesource.com/41794 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
af7da9a53b
commit
e2560ace3c
2 changed files with 17 additions and 14 deletions
|
|
@ -59,7 +59,6 @@ type Node struct {
|
|||
Etype types.EType // op for OASOP, etype for OTYPE, exclam for export, 6g saved reg, ChanDir for OTCHAN, for OINDEXMAP 1=LHS,0=RHS
|
||||
Class Class // PPARAM, PAUTO, PEXTERN, etc
|
||||
Typecheck uint8 // tracks state during typechecking; 2 == loop detected
|
||||
Initorder uint8
|
||||
}
|
||||
|
||||
// IsAutoTmp indicates if n was created by the compiler as a temporary,
|
||||
|
|
@ -72,8 +71,10 @@ func (n *Node) IsAutoTmp() bool {
|
|||
}
|
||||
|
||||
const (
|
||||
nodeWalkdef, _ = iota, 1 << iota // tracks state during typecheckdef; 2 == loop detected; two bits
|
||||
_, _ // second nodeWalkdef bit
|
||||
nodeWalkdef, _ = iota, 1 << iota // tracks state during typecheckdef; 2 == loop detected; two bits
|
||||
_, _ // second nodeWalkdef bit
|
||||
nodeInitorder, _ // tracks state during init1; two bits
|
||||
_, _ // second nodeInitorder bit
|
||||
_, nodeHasBreak
|
||||
_, nodeIsClosureVar
|
||||
_, nodeIsOutputParamHeapAddr
|
||||
|
|
@ -97,7 +98,8 @@ const (
|
|||
_, nodeEmbedded // ODCLFIELD embedded type
|
||||
)
|
||||
|
||||
func (n *Node) Walkdef() uint8 { return n.flags.get2(nodeWalkdef) }
|
||||
func (n *Node) Walkdef() uint8 { return n.flags.get2(nodeWalkdef) }
|
||||
func (n *Node) Initorder() uint8 { return n.flags.get2(nodeInitorder) }
|
||||
|
||||
func (n *Node) HasBreak() bool { return n.flags&nodeHasBreak != 0 }
|
||||
func (n *Node) IsClosureVar() bool { return n.flags&nodeIsClosureVar != 0 }
|
||||
|
|
@ -121,7 +123,8 @@ func (n *Node) HasVal() bool { return n.flags&nodeHasVal != 0 }
|
|||
func (n *Node) HasOpt() bool { return n.flags&nodeHasOpt != 0 }
|
||||
func (n *Node) Embedded() bool { return n.flags&nodeEmbedded != 0 }
|
||||
|
||||
func (n *Node) SetWalkdef(b uint8) { n.flags.set2(nodeWalkdef, b) }
|
||||
func (n *Node) SetWalkdef(b uint8) { n.flags.set2(nodeWalkdef, b) }
|
||||
func (n *Node) SetInitorder(b uint8) { n.flags.set2(nodeInitorder, b) }
|
||||
|
||||
func (n *Node) SetHasBreak(b bool) { n.flags.set(nodeHasBreak, b) }
|
||||
func (n *Node) SetIsClosureVar(b bool) { n.flags.set(nodeIsClosureVar, b) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue