Skip to content

Commit c6da141

Browse files
committed
Phase 5.B c10: lir_c_api.cpp jit_lir_opcode_guard -> static inline
Last trivial inline-conversion in lir_c_api.cpp BasicBlock/Function/ Instruction/Operand class. Closes c8-c10 mini-batch. Files: M Python/jit/lir/lir_c_api.h +6 / -2 (1 static inline) M Python/jit/lir/lir_c_api.cpp +2 / -5 (1 wrapper body removed) Net: -7 / +8 = +1 LOC. Inlined: jit_lir_opcode_guard -> JIT_LIR_OP_GUARD constant (lir_types_c.h:192 = 6, matches kGuard enum value at C++ side via static_assert indirectly — Instruction.opcode_ field offset cross-validated in lir_instr_c_verify.cpp). Caller audit: jit_lir_opcode_guard called from .c files for opcode comparison; inline preserves exact return value. Comprehensive .h-decl <-> .cpp-defn enumeration: 1 declaration mapped to 1 definition; 1 inlined; 0 missed. Strict 1-wrapper scope per supervisor 20:46:45Z (no expansion despite escape clauses in prior dispatches). PRE-COMMIT BUILD VERIFIED via pre-commit hook a2e8808. POST-c10 PIVOT decision pending per theologian 20:45:53Z + supervisor 20:46:45Z: lir_c_api.cpp inline-conversion class diminishing returns; remaining 45 wrappers are substantive codegen::Environ + arch::* bridges, not byte-equivalent C-validated. Recommend pivot to Phase 5.E InstrProperty C-port OR Phase 5.B-extension to generator.cpp/regalloc.cpp. Supervisor decides at c10 close.
1 parent f938c22 commit c6da141

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎Python/jit/lir/lir_c_api.cpp‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,8 @@ using jit::lir::OperandBase;
6565
* inlined as static inline in lir_c_api.h. */
6666

6767
/* ---- Opcode constants ---- */
68-
69-
extern "C" int
70-
jit_lir_opcode_guard(void) {
71-
return static_cast<int>(Instruction::kGuard);
72-
}
68+
/* Phase 5.B c10: jit_lir_opcode_guard inlined in lir_c_api.h
69+
* (returns JIT_LIR_OP_GUARD constant from lir_types_c.h:192). */
7370

7471
/* ---- DCE instruction accessors ---- */
7572
/* Phase 5.B c7: jit_lir_instr_id inlined in lir_c_api.h. */

‎Python/jit/lir/lir_c_api.h‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,12 @@ jit_lir_operand_get_basic_block(JitLirOperand op) {
183183
return o->value_.block;
184184
}
185185

186-
/* Opcode constants */
187-
int jit_lir_opcode_guard(void);
186+
/* Opcode constants — Phase 5.B c10: inlined as static inline. */
187+
188+
static inline int
189+
jit_lir_opcode_guard(void) {
190+
return JIT_LIR_OP_GUARD;
191+
}
188192

189193
/* DCE instruction accessors */
190194
static inline int

0 commit comments

Comments
 (0)