summaryrefslogtreecommitdiffstats
path: root/Tools/cases_generator
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-11-22 15:19:50 (GMT)
committerGitHub <noreply@github.com>2023-11-22 15:19:50 (GMT)
commit1619f4350ee431d2fa2f7c0b89702e897d9d14a2 (patch)
treeb98947d98103a20731632b3b31a56a31b8bccb07 /Tools/cases_generator
parentfef6fb876267f28fbb2c5fcb17aebe1a52cc8e12 (diff)
downloadcpython-1619f4350ee431d2fa2f7c0b89702e897d9d14a2.zip
cpython-1619f4350ee431d2fa2f7c0b89702e897d9d14a2.tar.gz
cpython-1619f4350ee431d2fa2f7c0b89702e897d9d14a2.tar.bz2
GH-111485: Sort cases in the case generator output (GH-112315)
Diffstat (limited to 'Tools/cases_generator')
-rw-r--r--Tools/cases_generator/generate_cases.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Tools/cases_generator/generate_cases.py b/Tools/cases_generator/generate_cases.py
index 851bd2f..1f94c1f 100644
--- a/Tools/cases_generator/generate_cases.py
+++ b/Tools/cases_generator/generate_cases.py
@@ -769,6 +769,7 @@ class Generator(Analyzer):
# Write and count instructions of all kinds
n_macros = 0
+ cases = []
for thing in self.everything:
match thing:
case parsing.InstDef():
@@ -776,11 +777,14 @@ class Generator(Analyzer):
case parsing.Macro():
n_macros += 1
mac = self.macro_instrs[thing.name]
- stacking.write_macro_instr(mac, self.out)
+ cases.append((mac.name, mac))
case parsing.Pseudo():
pass
case _:
assert_never(thing)
+ cases.sort()
+ for _, mac in cases:
+ stacking.write_macro_instr(mac, self.out)
self.out.write_raw("\n")
self.out.write_raw("#undef TIER_ONE\n")