| 42 | DECLARE_PYTHON(3, 14) |
| 43 | |
| 44 | const char* Pyc::OpcodeName(int opcode) |
| 45 | { |
| 46 | static const char* opcode_names[] = { |
| 47 | #define OPCODE(x) #x, |
| 48 | #define OPCODE_A_FIRST(x) #x, |
| 49 | #define OPCODE_A(x) #x, |
| 50 | #include "bytecode_ops.inl" |
| 51 | #undef OPCODE_A |
| 52 | #undef OPCODE_A_FIRST |
| 53 | #undef OPCODE |
| 54 | }; |
| 55 | |
| 56 | #if __cplusplus >= 201103L |
| 57 | static_assert(sizeof(opcode_names) / sizeof(opcode_names[0]) == PYC_LAST_OPCODE, |
| 58 | "Pyc::OpcodeName opcode_names not in sync with opcode enum"); |
| 59 | #endif |
| 60 | |
| 61 | if (opcode < 0) |
| 62 | return "<INVALID>"; |
| 63 | |
| 64 | if (opcode < PYC_LAST_OPCODE) |
| 65 | return opcode_names[opcode]; |
| 66 | |
| 67 | static char badcode[16]; |
| 68 | snprintf(badcode, sizeof(badcode), "<%d>", opcode); |
| 69 | return badcode; |
| 70 | }; |
| 71 | |
| 72 | int Pyc::ByteToOpcode(int maj, int min, int opcode) |
| 73 | { |
nothing calls this directly
no outgoing calls
no test coverage detected