Commit 3628c2d5 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: remove {Mark,Pop}dcl calls in bimport

These were previously only relevant for recording scoping level so
that invalid 'fallthrough' statements could be rejected. However,
that's handled differently since CL 61130 (in particular, there's no
use of types.Block anymore), so these calls can be safely removed.

Passes toolstash-check.

Change-Id: I8631b156594df85b8d39f57acad3ebcf099d52f9
Reviewed-on: https://go-review.googlesource.com/64810
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
parent 36e1c7ab
......@@ -1134,53 +1134,43 @@ func (p *importer) node() *Node {
return nodl(p.pos(), op, p.expr(), nil)
case OIF:
types.Markdcl()
n := nodl(p.pos(), OIF, nil, nil)
n.Ninit.Set(p.stmtList())
n.Left = p.expr()
n.Nbody.Set(p.stmtList())
n.Rlist.Set(p.stmtList())
types.Popdcl()
return n
case OFOR:
types.Markdcl()
n := nodl(p.pos(), OFOR, nil, nil)
n.Ninit.Set(p.stmtList())
n.Left, n.Right = p.exprsOrNil()
n.Nbody.Set(p.stmtList())
types.Popdcl()
return n
case ORANGE:
types.Markdcl()
n := nodl(p.pos(), ORANGE, nil, nil)
n.List.Set(p.stmtList())
n.Right = p.expr()
n.Nbody.Set(p.stmtList())
types.Popdcl()
return n
case OSELECT, OSWITCH:
types.Markdcl()
n := nodl(p.pos(), op, nil, nil)
n.Ninit.Set(p.stmtList())
n.Left, _ = p.exprsOrNil()
n.List.Set(p.stmtList())
types.Popdcl()
return n
// case OCASE, OXCASE:
// unreachable - mapped to OXCASE case below by exporter
case OXCASE:
types.Markdcl()
n := nodl(p.pos(), OXCASE, nil, nil)
n.List.Set(p.exprList())
// TODO(gri) eventually we must declare variables for type switch
// statements (type switch statements are not yet exported)
n.Nbody.Set(p.stmtList())
types.Popdcl()
return n
// case OFALL:
......
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