Skip to content

Commit 5779677

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent 0d8a3b2 commit 5779677

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,11 +1227,7 @@ func (p *exporter) expr(n *Node) {
12271227
case OTYPE:
12281228
p.op(OTYPE)
12291229
p.pos(n)
1230-
if p.bool(n.Type == nil) {
1231-
p.sym(n)
1232-
} else {
1233-
p.typ(n.Type)
1234-
}
1230+
p.typ(n.Type)
12351231

12361232
// case OTARRAY, OTMAP, OTCHAN, OTSTRUCT, OTINTER, OTFUNC:
12371233
// should have been resolved by typechecking - handled by default case

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -947,11 +947,7 @@ func (p *importer) node() *Node {
947947
// unreachable - should have been resolved by typechecking
948948

949949
case OTYPE:
950-
pos := p.pos()
951-
if p.bool() {
952-
return npos(pos, mkname(p.sym()))
953-
}
954-
return npos(pos, typenod(p.typ()))
950+
return npos(p.pos(), typenod(p.typ()))
955951

956952
// case OTARRAY, OTMAP, OTCHAN, OTSTRUCT, OTINTER, OTFUNC:
957953
// unreachable - should have been resolved by typechecking

0 commit comments

Comments
 (0)