[dev.regabi] cmd/compile: merge OBLOCK and OEMPTY

OEMPTY is an empty *statement*, but it confusingly
gets handled as an expression in a few places.
More confusingly, OEMPTY often has an init list,
making it not empty at all. Replace uses and analysis
of OEMPTY with OBLOCK instead.

Passes buildall w/ toolstash -cmp.

Change-Id: I8d4fcef151e4f441fa19b1b96da5272d778131d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/274594
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Russ Cox 2020-11-30 21:56:24 -05:00
parent c769d393de
commit ec5f349b22
13 changed files with 53 additions and 48 deletions

View file

@ -301,7 +301,7 @@ const (
OCASE
OCONTINUE // continue [Sym]
ODEFER // defer Left (Left must be call)
OEMPTY // no-op (empty statement)
OEMPTY // TODO(rsc): Delete. (Use OBLOCK instead.)
OFALL // fallthrough
OFOR // for Ninit; Left; Right { Nbody }
// OFORUNTIL is like OFOR, but the test (Left) is applied after the body:
@ -781,8 +781,6 @@ func NodAt(pos src.XPos, op Op, nleft, nright Node) Node {
n := NewTypeAssertExpr(pos, nleft, typ)
n.SetOp(op)
return n
case OEMPTY:
return NewEmptyStmt(pos)
case OFOR:
return NewForStmt(pos, nil, nleft, nright, nil)
case OGO: