mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-106360: remove redundant #ifdef (#106622)
This commit is contained in:
parent
95b7426f45
commit
388b5daa52
2 changed files with 3 additions and 7 deletions
|
@ -1240,7 +1240,7 @@ class Analyzer:
|
|||
self.out.emit("extern const struct opcode_metadata _PyOpcode_opcode_metadata[512];")
|
||||
self.out.emit("extern const struct opcode_macro_expansion _PyOpcode_macro_expansion[256];")
|
||||
self.out.emit("extern const char * const _PyOpcode_uop_name[512];")
|
||||
self.out.emit("#else")
|
||||
self.out.emit("#else // if NEED_OPCODE_METADATA")
|
||||
|
||||
self.out.emit("const struct opcode_metadata _PyOpcode_opcode_metadata[512] = {")
|
||||
|
||||
|
@ -1289,12 +1289,10 @@ class Analyzer:
|
|||
case _:
|
||||
typing.assert_never(thing)
|
||||
|
||||
self.out.emit("#ifdef NEED_OPCODE_METADATA")
|
||||
with self.out.block("const char * const _PyOpcode_uop_name[512] =", ";"):
|
||||
self.write_uop_items(lambda name, counter: f"[{counter}] = \"{name}\",")
|
||||
self.out.emit("#endif // NEED_OPCODE_METADATA")
|
||||
|
||||
self.out.emit("#endif")
|
||||
self.out.emit("#endif // NEED_OPCODE_METADATA")
|
||||
|
||||
with open(self.pymetadata_filename, "w") as f:
|
||||
# Create formatter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue