1
0
mirror of https://github.com/golang/go synced 2024-10-04 17:11:21 -06:00

[dev.ssa] cmd/compile: improve stability of generated code

If the files in cmd/compile/internal/ssa/gen
are passed to go run in a different order,
e.g. due to shell differences or manual entry,
then the order of constants in opGen churns.

Sort archs by name to enforce stability.
The movement of the PPC constants is a one time cost.

Change-Id: Iebcfdb9e612d7dd8cde575f920f1292891f2f24a
Reviewed-on: https://go-review.googlesource.com/24680
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Josh Bleecher Snyder 2016-06-30 11:13:24 -07:00
parent 03d152f36f
commit 95427d2549
2 changed files with 929 additions and 922 deletions

View File

@ -77,6 +77,7 @@ var archs []arch
func main() { func main() {
flag.Parse() flag.Parse()
sort.Sort(ArchsByName(archs))
genOp() genOp()
genLower() genLower()
} }
@ -306,3 +307,9 @@ type byKey []intPair
func (a byKey) Len() int { return len(a) } func (a byKey) Len() int { return len(a) }
func (a byKey) Swap(i, j int) { a[i], a[j] = a[j], a[i] } func (a byKey) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a byKey) Less(i, j int) bool { return a[i].key < a[j].key } func (a byKey) Less(i, j int) bool { return a[i].key < a[j].key }
type ArchsByName []arch
func (x ArchsByName) Len() int { return len(x) }
func (x ArchsByName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
func (x ArchsByName) Less(i, j int) bool { return x[i].name < x[j].name }

File diff suppressed because it is too large Load Diff