]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: use exported field names in rulegen
authorDaniel Martí <mvdan@mvdan.cc>
Sat, 18 Apr 2020 13:38:09 +0000 (14:38 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sat, 18 Apr 2020 20:01:46 +0000 (20:01 +0000)
commitf5291cf03d58e004eae67eeb904efbf46aba666a
tree93e0f4e030e640bb22f7d2519cee6b46d07d182b
parent98c6b9844b3c3a14eaa46515a7f63fed2deb57ce
cmd/compile: use exported field names in rulegen

The types used while generating code, such as Rule and File, have been
exported for a while. This is harmless for a main package, and lets us
easily differentiate types from variables and functions, as well as use
names like "If" since "if" is a keyword.

However, the fields remained unexported. This was a bit inconsistent,
and also meant that we couldn't use some intuitive names like If.else.
Export them.

Besides the capitalization, the only change is that the If type now has
the fields Then and Else, instead of stmt and alt.

Change-Id: I426ff140c6ca186fec394f17b29165861da5fd98
Reviewed-on: https://go-review.googlesource.com/c/go/+/228821
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/ssa/gen/main.go
src/cmd/compile/internal/ssa/gen/rulegen.go