Skip to content

Commit 4291adf

Browse files
committed
Fix types and bug for pseudos
1 parent 8da9d1b commit 4291adf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Tools/cases_generator/generate_cases.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ class OverriddenInstructionPlaceHolder:
491491
name: str
492492

493493

494-
AnyInstruction = Instruction | MacroInstruction
494+
AnyInstruction = Instruction | MacroInstruction | PseudoInstruction
495495
INSTR_FMT_PREFIX = "INSTR_FMT_"
496496

497497

@@ -530,6 +530,7 @@ def error(self, msg: str, node: parser.Node) -> None:
530530
macros: dict[str, parser.Macro]
531531
macro_instrs: dict[str, MacroInstruction]
532532
families: dict[str, parser.Family]
533+
pseudos: dict[str, parser.Pseudo]
533534
pseudo_instrs: dict[str, PseudoInstruction]
534535

535536
def parse(self) -> None:
@@ -587,7 +588,7 @@ def parse_file(self, filename: str, instrs_idx: dict[str, int]) -> None:
587588

588589
# Parse from start
589590
psr.setpos(start)
590-
thing: parser.InstDef | parser.Macro | parser.Family | None
591+
thing: parser.InstDef | parser.Macro | parser.Pseudo | parser.Family | None
591592
thing_first_token = psr.peek()
592593
while thing := psr.definition():
593594
match thing:
@@ -900,7 +901,7 @@ def effect_str(effects: list[StackEffect]) -> str:
900901
popped = str(-low)
901902
pushed = str(sp - low)
902903
case parser.Pseudo():
903-
instr = self.pseudos[thing.name]
904+
instr = self.pseudo_instrs[thing.name]
904905
popped = pushed = None
905906
# Calculate stack effect, and check that it's the the same
906907
# for all targets.

0 commit comments

Comments
 (0)