cmd/compile/internal/gc: simplify export info

Followup to previous typenod CL. Changes export data format, but only
the compiler-specific section, so no version bump.

Change-Id: I0c21737141f3d257366b29b2a9211bc7217c39ee
Reviewed-on: https://go-review.googlesource.com/39797
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Matthew Dempsky 2017-04-06 13:04:34 -07:00
parent 2e1b42a814
commit a680a85ea7
2 changed files with 2 additions and 19 deletions

View File

@ -1273,10 +1273,6 @@ func (p *exporter) expr(n *Node) {
p.op(ODOTTYPE)
p.pos(n)
p.expr(n.Left)
if n.Right != nil {
Fatalf("impossible")
}
p.bool(false)
p.typ(n.Type)
case OINDEX, OINDEXMAP:
@ -1311,13 +1307,8 @@ func (p *exporter) expr(n *Node) {
case OCONV, OCONVIFACE, OCONVNOP, OARRAYBYTESTR, OARRAYRUNESTR, OSTRARRAYBYTE, OSTRARRAYRUNE, ORUNESTR:
p.op(OCONV)
p.pos(n)
p.expr(n.Left)
p.typ(n.Type)
if n.Left != nil {
p.expr(n.Left)
p.op(OEND)
} else {
p.exprList(n.List) // emits terminating OEND
}
case OREAL, OIMAG, OAPPEND, OCAP, OCLOSE, ODELETE, OLEN, OMAKE, ONEW, OPANIC, ORECOVER, OPRINT, OPRINTN:
p.op(op)

View File

@ -960,9 +960,6 @@ func (p *importer) node() *Node {
case ODOTTYPE:
n := nodl(p.pos(), ODOTTYPE, p.expr(), nil)
if p.bool() {
Fatalf("impossible")
}
n.Type = p.typ()
return n
@ -986,13 +983,8 @@ func (p *importer) node() *Node {
// unreachable - mapped to OCONV case below by exporter
case OCONV:
n := nodl(p.pos(), OCONV, nil, nil)
n := nodl(p.pos(), OCONV, p.expr(), nil)
n.Type = p.typ()
exprs := p.exprList()
if len(exprs) != 1 {
Fatalf("impossible")
}
n.Left = exprs[0]
return n
case OCOPY, OCOMPLEX, OREAL, OIMAG, OAPPEND, OCAP, OCLOSE, ODELETE, OLEN, OMAKE, ONEW, OPANIC, ORECOVER, OPRINT, OPRINTN: