With the removal of the old backend,
a Label is just a Node.
Passes toolstash -cmp.
Change-Id: Ia62cb00fbc551efb75a4ed4dc6ed54fca0831dbf
Reviewed-on: https://go-review.googlesource.com/32216
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
// Mark labels that have no backjumps to them as not increasing e.loopdepth.
// Walk hasn't generated (goto|label).Left.Sym.Label yet, so we'll cheat
// and set it to one of the following two. Then in esc we'll clear it again.
-var looping Label
-
-var nonlooping Label
+var (
+ looping Node
+ nonlooping Node
+)
func (e *EscState) escloopdepthlist(l Nodes) {
for _, n := range l.Slice() {
Block int32 // blocknumber to catch redeclaration
Lastlineno int32 // last declaration for diagnostic
- Label *Label // corresponding label (ephemeral)
- Origpkg *Pkg // original package for . import
+ Label *Node // corresponding label (ephemeral)
+ Origpkg *Pkg // original package for . import
Lsym *obj.LSym
Fsym *Sym // funcsym
}
-type Label struct {
- Def *Node
-}
-
type SymFlags uint8
const (
} else {
lab := n.Left.Sym.Label
if lab != nil {
- lab.Def.SetHasBreak(true)
+ lab.SetHasBreak(true)
}
}
if n.Op == OLABEL && i+1 < len(s) && n.Name.Defn == s[i+1] {
switch n.Name.Defn.Op {
case OFOR, OSWITCH, OTYPESW, OSELECT, ORANGE:
- lab := new(Label)
- lab.Def = n.Name.Defn
- n.Left.Sym.Label = lab
+ n.Left.Sym.Label = n.Name.Defn
markbreak(n.Name.Defn, n.Name.Defn)
n.Left.Sym.Label = nil
i++