cmd/compile: merge Node.Opt and Node.Val behind access methods
$ sizeof -p cmd/compile/internal/gc Node
Node 144
$
Change-Id: I688e3790964fe42f48c19f697ec38094a92fe1c1
Reviewed-on: https://go-review.googlesource.com/10531
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/src/cmd/compile/internal/gc/dcl.go b/src/cmd/compile/internal/gc/dcl.go
index 7cdf3cc..cba8e21 100644
--- a/src/cmd/compile/internal/gc/dcl.go
+++ b/src/cmd/compile/internal/gc/dcl.go
@@ -833,10 +833,10 @@
f.Broke = 1
}
- switch n.Val.Ctype() {
+ switch n.Val().Ctype() {
case CTSTR:
f.Note = new(string)
- *f.Note = n.Val.U.(string)
+ *f.Note = n.Val().U.(string)
default:
Yyerror("field annotation must be string")
@@ -942,7 +942,7 @@
Fatal("interfacefield: oops %v\n", n)
}
- if n.Val.Ctype() != CTxxx {
+ if n.Val().Ctype() != CTxxx {
Yyerror("interface method cannot have annotation")
}