[dev.regabi] cmd/compile: split SliceExpr.List into separate fields

Passes toolstash -cmp.

Change-Id: I4e31154d04d99f2b80bec6a2c571a2a4a3f2ec99
Reviewed-on: https://go-review.googlesource.com/c/go/+/279959
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Matthew Dempsky 2020-12-23 06:06:31 -08:00
parent d19018e8f1
commit d1d64e4cea
15 changed files with 72 additions and 151 deletions

View file

@ -682,15 +682,14 @@ func (p *noder) expr(expr syntax.Expr) ir.Node {
if expr.Full {
op = ir.OSLICE3
}
n := ir.NewSliceExpr(p.pos(expr), op, p.expr(expr.X))
x := p.expr(expr.X)
var index [3]ir.Node
for i, x := range &expr.Index {
if x != nil {
index[i] = p.expr(x)
for i, n := range &expr.Index {
if n != nil {
index[i] = p.expr(n)
}
}
n.SetSliceBounds(index[0], index[1], index[2])
return n
return ir.NewSliceExpr(p.pos(expr), op, x, index[0], index[1], index[2])
case *syntax.AssertExpr:
return ir.NewTypeAssertExpr(p.pos(expr), p.expr(expr.X), p.typeExpr(expr.Type))
case *syntax.Operation: