mirror of
https://github.com/python/cpython.git
synced 2025-11-12 15:09:14 +00:00
gh-109287: fix overrides in cases generator (#110419)
This commit is contained in:
parent
bb057b3370
commit
3c0f65ebce
4 changed files with 37 additions and 31 deletions
|
|
@ -26,7 +26,6 @@ from instructions import (
|
|||
MacroInstruction,
|
||||
MacroParts,
|
||||
PseudoInstruction,
|
||||
OverriddenInstructionPlaceHolder,
|
||||
TIER_ONE,
|
||||
TIER_TWO,
|
||||
)
|
||||
|
|
@ -208,8 +207,6 @@ class Generator(Analyzer):
|
|||
popped_data: list[tuple[AnyInstruction, str]] = []
|
||||
pushed_data: list[tuple[AnyInstruction, str]] = []
|
||||
for thing in self.everything:
|
||||
if isinstance(thing, OverriddenInstructionPlaceHolder):
|
||||
continue
|
||||
if isinstance(thing, parsing.Macro) and thing.name in self.instrs:
|
||||
continue
|
||||
instr, popped, pushed = self.get_stack_effect_info(thing)
|
||||
|
|
@ -393,8 +390,6 @@ class Generator(Analyzer):
|
|||
for thing in self.everything:
|
||||
format: str | None = None
|
||||
match thing:
|
||||
case OverriddenInstructionPlaceHolder():
|
||||
continue
|
||||
case parsing.InstDef():
|
||||
format = self.instrs[thing.name].instr_fmt
|
||||
case parsing.Macro():
|
||||
|
|
@ -492,8 +487,6 @@ class Generator(Analyzer):
|
|||
# Write metadata for each instruction
|
||||
for thing in self.everything:
|
||||
match thing:
|
||||
case OverriddenInstructionPlaceHolder():
|
||||
continue
|
||||
case parsing.InstDef():
|
||||
self.write_metadata_for_inst(self.instrs[thing.name])
|
||||
case parsing.Macro():
|
||||
|
|
@ -774,8 +767,6 @@ class Generator(Analyzer):
|
|||
n_macros = 0
|
||||
for thing in self.everything:
|
||||
match thing:
|
||||
case OverriddenInstructionPlaceHolder():
|
||||
self.write_overridden_instr_place_holder(thing)
|
||||
case parsing.InstDef():
|
||||
pass
|
||||
case parsing.Macro():
|
||||
|
|
@ -836,14 +827,6 @@ class Generator(Analyzer):
|
|||
file=sys.stderr,
|
||||
)
|
||||
|
||||
def write_overridden_instr_place_holder(
|
||||
self, place_holder: OverriddenInstructionPlaceHolder
|
||||
) -> None:
|
||||
self.out.emit("")
|
||||
self.out.emit(
|
||||
f"{self.out.comment} TARGET({place_holder.name}) overridden by later definition"
|
||||
)
|
||||
|
||||
|
||||
def is_super_instruction(mac: MacroInstruction) -> bool:
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue