]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: refactor symbol sorting logic
authorMatthew Dempsky <mdempsky@google.com>
Mon, 9 Apr 2018 20:57:56 +0000 (13:57 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 9 Apr 2018 22:58:21 +0000 (22:58 +0000)
commitc3473c4f10c93189cf312576df2ce05202948e52
tree6e3867211a9eefdb81b7fbc4022b7891122f4293
parent71bac7efe45b18894415a169b669cb1df95d8079
cmd/compile: refactor symbol sorting logic

This used to be duplicated in methcmp and siglt, because Sig used its
own representation for Syms. Instead, just use Syms, and add a
(*Sym).Less method that both methcmp and siglt can use.

Also, prune some impossible cases purportedly related to blank
methods: the Go spec disallows blank methods in interface method sets,
and addmethod drops blank methods without actually recording them in
the type's method set.

Passes toolstash-check.

Updates #24693.

Change-Id: I24e981659b68504d71518160486989a82505f513
Reviewed-on: https://go-review.googlesource.com/105936
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/fmt_test.go
src/cmd/compile/internal/gc/reflect.go
src/cmd/compile/internal/gc/reflect_test.go [deleted file]
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/types/sym.go
src/cmd/compile/internal/types/sym_test.go [new file with mode: 0644]