Commit 3f4f119b authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile/internal/gc: npos(p, nod(o, l, r)) -> nodl(p, o, l, r)

Prepared with gofmt -r.

Passes toolstash-check.

Change-Id: I8a4f7a8c365dfe464dfc5868a18c67d56af37749
Reviewed-on: https://go-review.googlesource.com/38739
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 835b17c8
...@@ -927,7 +927,7 @@ func (p *importer) node() *Node { ...@@ -927,7 +927,7 @@ func (p *importer) node() *Node {
return n return n
case OSTRUCTLIT: case OSTRUCTLIT:
n := npos(p.pos(), nod(OCOMPLIT, nil, typenod(p.typ()))) n := nodl(p.pos(), OCOMPLIT, nil, typenod(p.typ()))
n.List.Set(p.elemList()) // special handling of field names n.List.Set(p.elemList()) // special handling of field names
return n return n
...@@ -935,14 +935,14 @@ func (p *importer) node() *Node { ...@@ -935,14 +935,14 @@ func (p *importer) node() *Node {
// unreachable - mapped to case OCOMPLIT below by exporter // unreachable - mapped to case OCOMPLIT below by exporter
case OCOMPLIT: case OCOMPLIT:
n := npos(p.pos(), nod(OCOMPLIT, nil, typenod(p.typ()))) n := nodl(p.pos(), OCOMPLIT, nil, typenod(p.typ()))
n.List.Set(p.exprList()) n.List.Set(p.exprList())
return n return n
case OKEY: case OKEY:
pos := p.pos() pos := p.pos()
left, right := p.exprsOrNil() left, right := p.exprsOrNil()
return npos(pos, nod(OKEY, left, right)) return nodl(pos, OKEY, left, right)
// case OSTRUCTKEY: // case OSTRUCTKEY:
// unreachable - handled in case OSTRUCTLIT by elemList // unreachable - handled in case OSTRUCTLIT by elemList
...@@ -961,7 +961,7 @@ func (p *importer) node() *Node { ...@@ -961,7 +961,7 @@ func (p *importer) node() *Node {
// unreachable - mapped to case ODOTTYPE below by exporter // unreachable - mapped to case ODOTTYPE below by exporter
case ODOTTYPE: case ODOTTYPE:
n := npos(p.pos(), nod(ODOTTYPE, p.expr(), nil)) n := nodl(p.pos(), ODOTTYPE, p.expr(), nil)
if p.bool() { if p.bool() {
n.Right = p.expr() n.Right = p.expr()
} else { } else {
...@@ -973,10 +973,10 @@ func (p *importer) node() *Node { ...@@ -973,10 +973,10 @@ func (p *importer) node() *Node {
// unreachable - mapped to cases below by exporter // unreachable - mapped to cases below by exporter
case OINDEX: case OINDEX:
return npos(p.pos(), nod(op, p.expr(), p.expr())) return nodl(p.pos(), op, p.expr(), p.expr())
case OSLICE, OSLICE3: case OSLICE, OSLICE3:
n := npos(p.pos(), nod(op, p.expr(), nil)) n := nodl(p.pos(), op, p.expr(), nil)
low, high := p.exprsOrNil() low, high := p.exprsOrNil()
var max *Node var max *Node
if n.Op.IsSlice3() { if n.Op.IsSlice3() {
...@@ -989,7 +989,7 @@ func (p *importer) node() *Node { ...@@ -989,7 +989,7 @@ func (p *importer) node() *Node {
// unreachable - mapped to OCONV case below by exporter // unreachable - mapped to OCONV case below by exporter
case OCONV: case OCONV:
n := npos(p.pos(), nod(OCALL, typenod(p.typ()), nil)) n := nodl(p.pos(), OCALL, typenod(p.typ()), nil)
n.List.Set(p.exprList()) n.List.Set(p.exprList())
return n return n
...@@ -1005,7 +1005,7 @@ func (p *importer) node() *Node { ...@@ -1005,7 +1005,7 @@ func (p *importer) node() *Node {
// unreachable - mapped to OCALL case below by exporter // unreachable - mapped to OCALL case below by exporter
case OCALL: case OCALL:
n := npos(p.pos(), nod(OCALL, p.expr(), nil)) n := nodl(p.pos(), OCALL, p.expr(), nil)
n.List.Set(p.exprList()) n.List.Set(p.exprList())
n.SetIsddd(p.bool()) n.SetIsddd(p.bool())
return n return n
...@@ -1018,19 +1018,19 @@ func (p *importer) node() *Node { ...@@ -1018,19 +1018,19 @@ func (p *importer) node() *Node {
// unary expressions // unary expressions
case OPLUS, OMINUS, OADDR, OCOM, OIND, ONOT, ORECV: case OPLUS, OMINUS, OADDR, OCOM, OIND, ONOT, ORECV:
return npos(p.pos(), nod(op, p.expr(), nil)) return nodl(p.pos(), op, p.expr(), nil)
// binary expressions // binary expressions
case OADD, OAND, OANDAND, OANDNOT, ODIV, OEQ, OGE, OGT, OLE, OLT, case OADD, OAND, OANDAND, OANDNOT, ODIV, OEQ, OGE, OGT, OLE, OLT,
OLSH, OMOD, OMUL, ONE, OOR, OOROR, ORSH, OSEND, OSUB, OXOR: OLSH, OMOD, OMUL, ONE, OOR, OOROR, ORSH, OSEND, OSUB, OXOR:
return npos(p.pos(), nod(op, p.expr(), p.expr())) return nodl(p.pos(), op, p.expr(), p.expr())
case OADDSTR: case OADDSTR:
pos := p.pos() pos := p.pos()
list := p.exprList() list := p.exprList()
x := npos(pos, list[0]) x := npos(pos, list[0])
for _, y := range list[1:] { for _, y := range list[1:] {
x = npos(pos, nod(OADD, x, y)) x = nodl(pos, OADD, x, y)
} }
return x return x
...@@ -1039,7 +1039,7 @@ func (p *importer) node() *Node { ...@@ -1039,7 +1039,7 @@ func (p *importer) node() *Node {
case ODCLCONST: case ODCLCONST:
// TODO(gri) these should not be exported in the first place // TODO(gri) these should not be exported in the first place
return npos(p.pos(), nod(OEMPTY, nil, nil)) return nodl(p.pos(), OEMPTY, nil, nil)
// -------------------------------------------------------------------- // --------------------------------------------------------------------
// statements // statements
...@@ -1061,10 +1061,10 @@ func (p *importer) node() *Node { ...@@ -1061,10 +1061,10 @@ func (p *importer) node() *Node {
// unreachable - mapped to OAS case below by exporter // unreachable - mapped to OAS case below by exporter
case OAS: case OAS:
return npos(p.pos(), nod(OAS, p.expr(), p.expr())) return nodl(p.pos(), OAS, p.expr(), p.expr())
case OASOP: case OASOP:
n := npos(p.pos(), nod(OASOP, nil, nil)) n := nodl(p.pos(), OASOP, nil, nil)
n.Etype = EType(p.int()) n.Etype = EType(p.int())
n.Left = p.expr() n.Left = p.expr()
if !p.bool() { if !p.bool() {
...@@ -1079,13 +1079,13 @@ func (p *importer) node() *Node { ...@@ -1079,13 +1079,13 @@ func (p *importer) node() *Node {
// unreachable - mapped to OAS2 case below by exporter // unreachable - mapped to OAS2 case below by exporter
case OAS2: case OAS2:
n := npos(p.pos(), nod(OAS2, nil, nil)) n := nodl(p.pos(), OAS2, nil, nil)
n.List.Set(p.exprList()) n.List.Set(p.exprList())
n.Rlist.Set(p.exprList()) n.Rlist.Set(p.exprList())
return n return n
case ORETURN: case ORETURN:
n := npos(p.pos(), nod(ORETURN, nil, nil)) n := nodl(p.pos(), ORETURN, nil, nil)
n.List.Set(p.exprList()) n.List.Set(p.exprList())
return n return n
...@@ -1093,11 +1093,11 @@ func (p *importer) node() *Node { ...@@ -1093,11 +1093,11 @@ func (p *importer) node() *Node {
// unreachable - generated by compiler for trampolin routines (not exported) // unreachable - generated by compiler for trampolin routines (not exported)
case OPROC, ODEFER: case OPROC, ODEFER:
return npos(p.pos(), nod(op, p.expr(), nil)) return nodl(p.pos(), op, p.expr(), nil)
case OIF: case OIF:
markdcl() markdcl()
n := npos(p.pos(), nod(OIF, nil, nil)) n := nodl(p.pos(), OIF, nil, nil)
n.Ninit.Set(p.stmtList()) n.Ninit.Set(p.stmtList())
n.Left = p.expr() n.Left = p.expr()
n.Nbody.Set(p.stmtList()) n.Nbody.Set(p.stmtList())
...@@ -1107,7 +1107,7 @@ func (p *importer) node() *Node { ...@@ -1107,7 +1107,7 @@ func (p *importer) node() *Node {
case OFOR: case OFOR:
markdcl() markdcl()
n := npos(p.pos(), nod(OFOR, nil, nil)) n := nodl(p.pos(), OFOR, nil, nil)
n.Ninit.Set(p.stmtList()) n.Ninit.Set(p.stmtList())
n.Left, n.Right = p.exprsOrNil() n.Left, n.Right = p.exprsOrNil()
n.Nbody.Set(p.stmtList()) n.Nbody.Set(p.stmtList())
...@@ -1116,7 +1116,7 @@ func (p *importer) node() *Node { ...@@ -1116,7 +1116,7 @@ func (p *importer) node() *Node {
case ORANGE: case ORANGE:
markdcl() markdcl()
n := npos(p.pos(), nod(ORANGE, nil, nil)) n := nodl(p.pos(), ORANGE, nil, nil)
n.List.Set(p.stmtList()) n.List.Set(p.stmtList())
n.Right = p.expr() n.Right = p.expr()
n.Nbody.Set(p.stmtList()) n.Nbody.Set(p.stmtList())
...@@ -1125,7 +1125,7 @@ func (p *importer) node() *Node { ...@@ -1125,7 +1125,7 @@ func (p *importer) node() *Node {
case OSELECT, OSWITCH: case OSELECT, OSWITCH:
markdcl() markdcl()
n := npos(p.pos(), nod(op, nil, nil)) n := nodl(p.pos(), op, nil, nil)
n.Ninit.Set(p.stmtList()) n.Ninit.Set(p.stmtList())
n.Left, _ = p.exprsOrNil() n.Left, _ = p.exprsOrNil()
n.List.Set(p.stmtList()) n.List.Set(p.stmtList())
...@@ -1137,7 +1137,7 @@ func (p *importer) node() *Node { ...@@ -1137,7 +1137,7 @@ func (p *importer) node() *Node {
case OXCASE: case OXCASE:
markdcl() markdcl()
n := npos(p.pos(), nod(OXCASE, nil, nil)) n := nodl(p.pos(), OXCASE, nil, nil)
n.Xoffset = int64(block) n.Xoffset = int64(block)
n.List.Set(p.exprList()) n.List.Set(p.exprList())
// TODO(gri) eventually we must declare variables for type switch // TODO(gri) eventually we must declare variables for type switch
...@@ -1150,7 +1150,7 @@ func (p *importer) node() *Node { ...@@ -1150,7 +1150,7 @@ func (p *importer) node() *Node {
// unreachable - mapped to OXFALL case below by exporter // unreachable - mapped to OXFALL case below by exporter
case OXFALL: case OXFALL:
n := npos(p.pos(), nod(OXFALL, nil, nil)) n := nodl(p.pos(), OXFALL, nil, nil)
n.Xoffset = int64(block) n.Xoffset = int64(block)
return n return n
...@@ -1160,13 +1160,13 @@ func (p *importer) node() *Node { ...@@ -1160,13 +1160,13 @@ func (p *importer) node() *Node {
if left != nil { if left != nil {
left = newname(left.Sym) left = newname(left.Sym)
} }
return npos(pos, nod(op, left, nil)) return nodl(pos, op, left, nil)
// case OEMPTY: // case OEMPTY:
// unreachable - not emitted by exporter // unreachable - not emitted by exporter
case OGOTO, OLABEL: case OGOTO, OLABEL:
n := npos(p.pos(), nod(op, newname(p.expr().Sym), nil)) n := nodl(p.pos(), op, newname(p.expr().Sym), nil)
n.Sym = dclstack // context, for goto restrictions n.Sym = dclstack // context, for goto restrictions
return n return n
......
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