gh-106360: remove redundant #ifdef (#106622)

This commit is contained in:
Irit Katriel 2023-07-11 15:41:50 +03:00 committed by GitHub
parent 95b7426f45
commit 388b5daa52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View file

@ -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