]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] cmd/compile: stop reusing Ntype for OSLICELIT length
authorMatthew Dempsky <mdempsky@google.com>
Fri, 18 Dec 2020 02:47:26 +0000 (18:47 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 22 Dec 2020 17:04:18 +0000 (17:04 +0000)
commit3512cde10ac5e466527d69313b8250b2ea0146b1
tree3c985b80c8dd6235234743d0cbcf7d04c2ca595a
parent2755361e6abfd3a58acd5f7ebbcd05c23bc8261a
[dev.regabi] cmd/compile: stop reusing Ntype for OSLICELIT length

For OSLICELITs, we were reusing the Ntype field after type checking to
hold the length of the OSLICELIT's backing array. However, Ntype is
only meant for nodes that can represent types. Today, this works only
because we currently use Name for all OLITERAL constants (whether
declared or not), whereas we should be able to represent them more
compactly with a dedicated type that doesn't implement Ntype.

Passes buildall w/ toolstash -cmp.

Change-Id: I385f1d787c41b016f507a5bad9489d59ccfde7f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/279152
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/order.go
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/ir/expr.go