]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: clean up in preparation for expression Nodes
authorRuss Cox <rsc@golang.org>
Mon, 30 Nov 2020 02:11:07 +0000 (21:11 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 30 Nov 2020 23:48:24 +0000 (23:48 +0000)
commitb7f67b75d2fe94098afb618adc1badc12ce6e21c
tree21ac263198f48674009a60b306d211dd9d6f0dca
parent5fc192af56dd1a9977bf73175ab9e32232b4a14d
[dev.regabi] cmd/compile: clean up in preparation for expression Nodes

Using expression nodes restricts the set of valid SetOp operations,
because you can't SetOp across representation. Rewrite various code
to avoid crossing those as-yet-unintroduced boundaries.

This also includes choosing a single representation for any given Op.
For example, OCLOSE starts out as an OCALL, so it starts with a List
of one node and then moves that node to Left. That's no good with
real data structures, so the code picks a single canonical implementation
and prepares it during the conversion from one Op to the next.
In this case, the conversion of an OCALL to an OCLOSE now creates
a new node with Left initialized from the start. This pattern repeats.

Passes buildall w/ toolstash -cmp.

Change-Id: I55a0872c614d883cac9d64976c46aeeaa639e25d
Reviewed-on: https://go-review.googlesource.com/c/go/+/274107
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/gc/walk.go