From a680a85ea7f3876c78d093fbb2690db6ca8eda8b Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 6 Apr 2017 13:04:34 -0700 Subject: [PATCH] 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 Reviewed-by: Robert Griesemer TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/bexport.go | 11 +---------- src/cmd/compile/internal/gc/bimport.go | 10 +--------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/cmd/compile/internal/gc/bexport.go b/src/cmd/compile/internal/gc/bexport.go index 474b36412a..3555505bbf 100644 --- a/src/cmd/compile/internal/gc/bexport.go +++ b/src/cmd/compile/internal/gc/bexport.go @@ -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) diff --git a/src/cmd/compile/internal/gc/bimport.go b/src/cmd/compile/internal/gc/bimport.go index 5f4121d7b5..10cae7c165 100644 --- a/src/cmd/compile/internal/gc/bimport.go +++ b/src/cmd/compile/internal/gc/bimport.go @@ -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: -- 2.48.1