Commit a680a85e authored by Matthew Dempsky's avatar Matthew Dempsky

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: default avatarRobert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 2e1b42a8
......@@ -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)
......
......@@ -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:
......
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