mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/gc: replace Node.Ullman with Node.HasCall
Since switching to SSA, the only remaining use for the Ullman field was in tracking whether or not an expression contained a function call. Give it a new name and encode it in our fancy new bitset field. Passes toolstash-check. Change-Id: I95b7f9cb053856320c0d66efe14996667e6011c2 Reviewed-on: https://go-review.googlesource.com/37721 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
9fd359a29a
commit
870d079c76
11 changed files with 52 additions and 73 deletions
|
|
@ -49,12 +49,11 @@ type Node struct {
|
|||
|
||||
Pos src.XPos
|
||||
|
||||
flags bitset16
|
||||
flags bitset32
|
||||
|
||||
Esc uint16 // EscXXX
|
||||
|
||||
Op Op
|
||||
Ullman uint8 // sethi/ullman number
|
||||
Etype 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
|
||||
Embedded uint8 // ODCLFIELD embedded type
|
||||
|
|
@ -91,6 +90,7 @@ const (
|
|||
nodeBounded // bounds check unnecessary
|
||||
nodeAddable // addressable
|
||||
nodeUsed // for variable/label declared and not used error
|
||||
nodeHasCall // expression contains a function call
|
||||
)
|
||||
|
||||
func (n *Node) HasBreak() bool { return n.flags&nodeHasBreak != 0 }
|
||||
|
|
@ -109,6 +109,7 @@ func (n *Node) Noescape() bool { return n.flags&nodeNoescape != 0 }
|
|||
func (n *Node) Bounded() bool { return n.flags&nodeBounded != 0 }
|
||||
func (n *Node) Addable() bool { return n.flags&nodeAddable != 0 }
|
||||
func (n *Node) Used() bool { return n.flags&nodeUsed != 0 }
|
||||
func (n *Node) HasCall() bool { return n.flags&nodeHasCall != 0 }
|
||||
|
||||
func (n *Node) SetHasBreak(b bool) { n.flags.set(nodeHasBreak, b) }
|
||||
func (n *Node) SetIsClosureVar(b bool) { n.flags.set(nodeIsClosureVar, b) }
|
||||
|
|
@ -126,6 +127,7 @@ func (n *Node) SetNoescape(b bool) { n.flags.set(nodeNoescape, b) }
|
|||
func (n *Node) SetBounded(b bool) { n.flags.set(nodeBounded, b) }
|
||||
func (n *Node) SetAddable(b bool) { n.flags.set(nodeAddable, b) }
|
||||
func (n *Node) SetUsed(b bool) { n.flags.set(nodeUsed, b) }
|
||||
func (n *Node) SetHasCall(b bool) { n.flags.set(nodeHasCall, b) }
|
||||
|
||||
// Val returns the Val for the node.
|
||||
func (n *Node) Val() Val {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue