(
filenames: list[str], analysis: Analysis, outfile: TextIO
)
| 22 | |
| 23 | |
| 24 | def generate_opcode_header( |
| 25 | filenames: list[str], analysis: Analysis, outfile: TextIO |
| 26 | ) -> None: |
| 27 | write_header(__file__, filenames, outfile) |
| 28 | out = CWriter(outfile, 0, False) |
| 29 | with out.header_guard("Py_OPCODE_IDS_H"): |
| 30 | out.emit("/* Instruction opcodes for compiled code */\n") |
| 31 | |
| 32 | def write_define(name: str, op: int) -> None: |
| 33 | out.emit(f"#define {name:<38} {op:>3}\n") |
| 34 | |
| 35 | for op, name in sorted([(op, name) for (name, op) in analysis.opmap.items()]): |
| 36 | write_define(name, op) |
| 37 | |
| 38 | out.emit("\n") |
| 39 | write_define("HAVE_ARGUMENT", analysis.have_arg) |
| 40 | write_define("MIN_SPECIALIZED_OPCODE", analysis.opmap["RESUME"]+1) |
| 41 | write_define("MIN_INSTRUMENTED_OPCODE", analysis.min_instrumented) |
| 42 | |
| 43 | |
| 44 | arg_parser = argparse.ArgumentParser( |
no test coverage detected
searching dependent graphs…