cmd/compile: remove Val.Ctype
$ sizeof -p cmd/compile/internal/gc Node
Node 248
$
Change-Id: I0fbfeb0d0b36e225eb282fce9e480a96ec1d278f
Reviewed-on: https://go-review.googlesource.com/10524
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
diff --git a/src/cmd/compile/internal/gc/swt.go b/src/cmd/compile/internal/gc/swt.go
index a3df7e2..6f04328 100644
--- a/src/cmd/compile/internal/gc/swt.go
+++ b/src/cmd/compile/internal/gc/swt.go
@@ -579,7 +579,7 @@
switch c.typ {
case caseKindTypeNil:
var v Val
- v.Ctype = CTNIL
+ v.U = new(NilVal)
a = Nod(OIF, nil, nil)
a.Left = Nod(OEQ, s.facename, nodlit(v))
typecheck(&a.Left, Erv)
@@ -742,11 +742,11 @@
n2 := c2.node.Left
// sort by type (for switches on interface)
- ct := int(n1.Val.Ctype)
- if ct > int(n2.Val.Ctype) {
+ ct := int(n1.Val.Ctype())
+ if ct > int(n2.Val.Ctype()) {
return +1
}
- if ct < int(n2.Val.Ctype) {
+ if ct < int(n2.Val.Ctype()) {
return -1
}
if !Eqtype(n1.Type, n2.Type) {