Skip to content

Commit 289c258

Browse files
committed
Streamline write_abstract_interpreter_instructions()
1 parent b53875d commit 289c258

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

Tools/cases_generator/generate_cases.py

+10-20
Original file line numberDiff line numberDiff line change
@@ -821,26 +821,16 @@ def write_abstract_interpreter_instructions(
821821
with open(abstract_interpreter_filename, "w") as f:
822822
self.out = Formatter(f, 8, emit_line_directives)
823823
self.write_provenance_header()
824-
for thing in self.everything:
825-
match thing:
826-
case OverriddenInstructionPlaceHolder():
827-
pass
828-
case parsing.InstDef():
829-
instr = AbstractInstruction(self.instrs[thing.name].inst)
830-
if (
831-
instr.is_viable_uop()
832-
and instr.name not in SPECIALLY_HANDLED_ABSTRACT_INSTR
833-
):
834-
self.out.emit("")
835-
with self.out.block(f"case {thing.name}:"):
836-
instr.write(self.out, tier=TIER_TWO)
837-
self.out.emit("break;")
838-
case parsing.Macro():
839-
pass
840-
case parsing.Pseudo():
841-
pass
842-
case _:
843-
assert_never(thing)
824+
for instr in self.instrs.values():
825+
instr = AbstractInstruction(instr.inst)
826+
if (
827+
instr.is_viable_uop()
828+
and instr.name not in SPECIALLY_HANDLED_ABSTRACT_INSTR
829+
):
830+
self.out.emit("")
831+
with self.out.block(f"case {instr.name}:"):
832+
instr.write(self.out, tier=TIER_TWO)
833+
self.out.emit("break;")
844834
print(
845835
f"Wrote some stuff to {abstract_interpreter_filename}",
846836
file=sys.stderr,

0 commit comments

Comments
 (0)