]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: simplify export info
authorMatthew Dempsky <mdempsky@google.com>
Thu, 6 Apr 2017 20:04:34 +0000 (13:04 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 6 Apr 2017 22:56:15 +0000 (22:56 +0000)
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>

src/cmd/compile/internal/gc/bexport.go
src/cmd/compile/internal/gc/bimport.go

index 474b36412a46ccf5817a8be31ea85911d07c59aa..3555505bbf999a3cb932b14ef3b06527acc75dd7 100644 (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)
index 5f4121d7b5a159e573474560ea986d10273a1fa5..10cae7c165be6e6889145a29799e43e441b6eb15 100644 (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: