tools/tint/intrinsic: Sort enum values lexicographically

Reorders the output of the CanonicalizeEntryPointIO transform, but
otherwise is a no-op.

This will help with diagnostics that print the enum values.

Bug: tint:1629
Change-Id: Iff517d88836d2a8cd42ce3cfde6363c1973df0dd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/105321
Commit-Queue: Ben Clayton <bclayton@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ben Clayton
2022-10-11 18:26:18 +00:00
committed by Dawn LUCI CQ
parent ae832a2c6a
commit db368f1b9c
18 changed files with 427 additions and 418 deletions

View File

@@ -148,6 +148,9 @@ func (r *resolver) enum(e ast.EnumDecl) error {
names.Add(ast.Name)
}
// Sort the enum entries into lexicographic order
sort.Slice(s.Entries, func(i, j int) bool { return s.Entries[i].Name < s.Entries[j].Name })
return nil
}