GH-111485: Remove some special cases from the code generator and bytecodes.c (GH-111540)

This commit is contained in:
Mark Shannon 2023-10-31 13:21:07 +00:00 committed by GitHub
parent d27acd4461
commit 2904d99839
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 119 additions and 55 deletions

View file

@ -385,12 +385,9 @@ class Analyzer:
def analyze_pseudo(self, pseudo: parsing.Pseudo) -> PseudoInstruction:
targets = [self.instrs[target] for target in pseudo.targets]
assert targets
# Make sure the targets have the same fmt
fmts = list(set([t.instr_fmt for t in targets]))
assert len(fmts) == 1
ignored_flags = {"HAS_EVAL_BREAK_FLAG", "HAS_DEOPT_FLAG", "HAS_ERROR_FLAG"}
assert len({t.instr_flags.bitmap(ignore=ignored_flags) for t in targets}) == 1
return PseudoInstruction(pseudo.name, targets, fmts[0], targets[0].instr_flags)
return PseudoInstruction(pseudo.name, targets, targets[0].instr_flags)
def analyze_instruction(
self, instr: Instruction, offset: int