]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: refactor irgen's handling of ":="
authorMatthew Dempsky <mdempsky@google.com>
Fri, 22 Jan 2021 09:46:42 +0000 (01:46 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 22 Jan 2021 19:23:32 +0000 (19:23 +0000)
commite4ef30a66751c39bdd24764763531f1a4c325845
tree90f5ba028e2d0c70c39d1257324276c3b9ca5a36
parent626406b703a418acd41c4163b5c58d832c09e1e4
[dev.typeparams] cmd/compile: refactor irgen's handling of ":="

The previous code was stylized after noder, which was written when it
was more idiomatic to simple create a gc.Node and then populate and
shuffle around its fields as appropriate.

Now with package ir, it's somewhat nicer to compute all the fields up
front and pass them to the constructor functions, rather than passing
nil and populating the fields afterwards.

Net addition of lines of code, but I think the new code is overall
still somewhat simpler, and will be easier to refactor out into code
for helpers.go.

Change-Id: I8c6f6b65e0a8317129655a0fc493d8af75527b97
Reviewed-on: https://go-review.googlesource.com/c/go/+/285732
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/noder/stmt.go