mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-11 14:41:50 +00:00
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:
committed by
Dawn LUCI CQ
parent
ae832a2c6a
commit
db368f1b9c
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user