Commit 57796779 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile: simplify exporting OTYPE nodes

We only export packages that typechecked successfully, and OTYPE nodes
will always have their Type field set.

Changes the package export format, but only in the compiler-specific
section. No version bump necessary.

Change-Id: I722f5827e73948fceb0432bc8b3b22471fea8f61
Reviewed-on: https://go-review.googlesource.com/63273
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
parent 0d8a3b20
...@@ -1227,11 +1227,7 @@ func (p *exporter) expr(n *Node) { ...@@ -1227,11 +1227,7 @@ func (p *exporter) expr(n *Node) {
case OTYPE: case OTYPE:
p.op(OTYPE) p.op(OTYPE)
p.pos(n) p.pos(n)
if p.bool(n.Type == nil) { p.typ(n.Type)
p.sym(n)
} else {
p.typ(n.Type)
}
// case OTARRAY, OTMAP, OTCHAN, OTSTRUCT, OTINTER, OTFUNC: // case OTARRAY, OTMAP, OTCHAN, OTSTRUCT, OTINTER, OTFUNC:
// should have been resolved by typechecking - handled by default case // should have been resolved by typechecking - handled by default case
......
...@@ -947,11 +947,7 @@ func (p *importer) node() *Node { ...@@ -947,11 +947,7 @@ func (p *importer) node() *Node {
// unreachable - should have been resolved by typechecking // unreachable - should have been resolved by typechecking
case OTYPE: case OTYPE:
pos := p.pos() return npos(p.pos(), typenod(p.typ()))
if p.bool() {
return npos(pos, mkname(p.sym()))
}
return npos(pos, typenod(p.typ()))
// case OTARRAY, OTMAP, OTCHAN, OTSTRUCT, OTINTER, OTFUNC: // case OTARRAY, OTMAP, OTCHAN, OTSTRUCT, OTINTER, OTFUNC:
// unreachable - should have been resolved by typechecking // unreachable - should have been resolved by typechecking
......
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