Skip to content

Commit

Permalink
Fix: Duplicates in _PyOpcode_OpName (python#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaPoo authored Jul 11, 2023
1 parent 4dd472a commit e44bf1c
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 45 deletions.
15 changes: 10 additions & 5 deletions Include/internal/pycore_opcode.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 30 additions & 30 deletions Include/opcode.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Lib/opcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,8 @@ def pseudo_op(name, op, real_ops):
'BB_BRANCH', # When both exits have not been generated.
# The BB_BRANCH transitions to one of these two.
# This happens when the fall through is generated, but not the other branch.
'BB_BRANCH_IF_FLAG_UNSET', # When alternate exit is not yet generated.
'BB_BRANCH_IF_FLAG_SET', # When successor exit is not yet generated.
# Duplicated in the specialised # 'BB_BRANCH_IF_FLAG_UNSET', # When alternate exit is not yet generated.
# Duplicated in the specialised # 'BB_BRANCH_IF_FLAG_SET', # When successor exit is not yet generated.
# When both edges are generated
'BB_JUMP_IF_FLAG_UNSET',
'BB_JUMP_IF_FLAG_SET',
Expand All @@ -490,9 +490,9 @@ def pseudo_op(name, op, real_ops):
# These tests correspond to the jump instructions
# FOR_ITER's null (iterator) check
'BB_TEST_ITER',
'BB_TEST_ITER_RANGE',
'BB_TEST_ITER_LIST',
'BB_TEST_ITER_TUPLE',
# Duplicated in the specialised # 'BB_TEST_ITER_RANGE',
# Duplicated in the specialised # 'BB_TEST_ITER_LIST',
# Duplicated in the specialised # 'BB_TEST_ITER_TUPLE',
# POP_JUMP_IF_FALSE, POP_JUMP_IF_TRUE
'BB_TEST_POP_IF_FALSE',
'BB_TEST_POP_IF_TRUE',
Expand Down
10 changes: 5 additions & 5 deletions Python/opcode_targets.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Tools/build/generate_opcode_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def main(opcode_py, outfile='Include/opcode.h', internaloutfile='Include/interna
for name in opcode['_specialized_instructions']:
while used[next_op]:
next_op += 1
assert name not in opname_including_specialized
specialized_opmap[name] = next_op
opname_including_specialized[next_op] = name
used[next_op] = True
Expand All @@ -117,6 +118,7 @@ def main(opcode_py, outfile='Include/opcode.h', internaloutfile='Include/interna
for name in opcode['_uops']:
while used[next_op]:
next_op += 1
assert name not in opname_including_specialized
uop_opmap[name] = next_op
opname_including_specialized[next_op] = name
used[next_op] = True
Expand Down

0 comments on commit e44bf1c

Please sign in to comment.