mirror of
https://github.com/python/cpython.git
synced 2025-07-18 16:55:20 +00:00
gh-91428: Add _PyOpcode_OpName to opcode.h of debug builds (GH-91430)
This commit is contained in:
parent
3869a839d5
commit
8a35ce3796
3 changed files with 128 additions and 0 deletions
|
@ -108,6 +108,14 @@ def main(opcode_py, outfile='Include/opcode.h'):
|
|||
for i, (op, _) in enumerate(opcode["_nb_ops"]):
|
||||
fobj.write(DEFINE.format(op, i))
|
||||
|
||||
fobj.write("\n")
|
||||
fobj.write("#ifdef Py_DEBUG\n")
|
||||
fobj.write("static const char *const _PyOpcode_OpName[256] = {\n")
|
||||
for name in opmap:
|
||||
fobj.write(f''' [{name}] = "{name}",\n''')
|
||||
fobj.write("};\n")
|
||||
fobj.write("#endif\n")
|
||||
|
||||
fobj.write(footer)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue