Commit a7c84668 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: remove Label type

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: 's avatarMatthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent d6dbf3a0
......@@ -589,9 +589,10 @@ func (e *EscState) escfunc(fn *Node) {
// 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() {
......
......@@ -47,16 +47,12 @@ type Sym struct {
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 (
......
......@@ -3841,7 +3841,7 @@ func markbreak(n *Node, implicit *Node) {
} else {
lab := n.Left.Sym.Label
if lab != nil {
lab.Def.SetHasBreak(true)
lab.SetHasBreak(true)
}
}
......@@ -3872,9 +3872,7 @@ func markbreaklist(l Nodes, implicit *Node) {
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++
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment