internal/load: use alias slice for determinism

Previously aliases were stored in a map which was causing
non-deterministic code generation (see recent build failures). This diff
changes to a slice to avoid this problem.

Updates #50
This commit is contained in:
Michael McLoughlin
2019-01-20 23:06:42 -08:00
parent 2d7a9ddb6c
commit 02ecaad4e4
4 changed files with 61 additions and 53 deletions

View File

@@ -12,7 +12,7 @@ arch=${GOROOT}/src/cmd/asm/internal/arch/arch.go
echo
echo 'package load'
echo
echo 'var annoyingaliases = map[string]string{'
echo 'var annoyingaliases = []alias{'
awk '
/archX86/ { x86=1 }
@@ -27,7 +27,7 @@ arch=${GOROOT}/src/cmd/asm/internal/arch/arch.go
sub(/x86\.A/, "", to)
if(from != to) {
printf("\t\"%s\": \"%s\",\n", from, to)
printf("\t{\"%s\", \"%s\"},\n", from, to)
}
}
' ${arch}