]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: tweaks to match types2
authorMatthew Dempsky <mdempsky@google.com>
Thu, 27 May 2021 02:52:31 +0000 (19:52 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 27 May 2021 22:13:38 +0000 (22:13 +0000)
commitde5d1aca5e61e49e0704213961c68bcf14e288b8
tree75dc1b2d831442b26bc6e3e28a3274a12b82d7af
parentc2c1b53b39fd54b915b2a4bbae36d1c9793fac8a
[dev.typeparams] cmd/compile: tweaks to match types2

This CL makes a handful of changes to either bring existing compiler
output consistent with what types2 produces or to make it easier to
reproduce with types2:

1. The position for embedded fields is corrected to the position of
the syntax.Field, rather than the syntax.Type.

2. Methods and embedded types are sorted in export data the same way
that types2 sorts them.

3. Don't write out position information for OLITERALs that don't have
their own position (i.e., references to named constants).

Change-Id: Ic3979215ae9ef280cfbba7b44c236e03fc12a2ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/323209
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/noder/noder.go
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/types/size.go
src/cmd/compile/internal/types/sort.go