Skip to content

Commit d0e8031

Browse files
committed
W25 Step B-0: cfg.cpp local extern → helper-own-header include
Per W25 spec §3 Step B + theologian [chat L2170] case-classification guidance. First B-0 test case to validate Step B pattern on smallest §1b TU before scaling to heavier ones. CASE: Class C2 (file-pair-scoped helper, NOT in canonical hir_c_api.h). cfg.cpp had 1 lint-pattern extern: extern "C" size_t hir_cfg_get_rpo_c(void *cfg, void **out, size_t capacity); hir_cfg_get_rpo_c is declared in hir_cfg_rpo_c.h:18 + defined in hir_cfg_rpo_c.c:19 — its own file pair, not part of hir_c_api.h's canonical surface (it's a parallel C implementation of CFG RPO traversal alongside the C++ hir_cfg_get_rpo). FIX: replace local extern with #include of helper's canonical header. - "cinderx/Jit/hir/cfg.h" (kept) - "cinderx/Jit/hir/hir_basic_block_c.h" (kept — §1b dual-include works post-W25 Step A) - "cinderx/Jit/hir/hir_cfg_rpo_c.h" (NEW — replaces local extern) NO call-site changes (hir_cfg_get_rpo_c name same in both contexts). NO canonical hir_c_api.h expansion needed (helper stays in own header). CASE-CLASSIFICATION REPORT for spec amendment: Class C2 pattern is COMMON — 5+ §1b/non-§1b TUs use this same hir_cfg_get_rpo_c local extern (cfg.cpp, licm_c.c, pass_output_type_c.c twice, refcount_env_bridge.cpp, dominator_c.c). Step B for these TUs is straightforward: replace local extern with #include of helper's own header. Spec §3 Step B should enumerate Class C2 explicitly: Class A (canonical match in hir_c_api.h): #include hir_c_api.h Class B (name mismatch): caller-rewrite + #include hir_c_api.h Class C2 (file-pair helper with own header): #include helper's header Class C1 (function not in any header): add to canonical OR move to a helper header testkeeper x86_64 compile-only PASS verified pre-commit at binary timestamp 1776887068. NEXT: testkeeper ARM64 pydebug --clean + 8-test gate. Then scale to B-1 (other small §1b TUs: ssaify_c.c 1 extern, hir_basic_block_c.c 1 extern, licm_c.c 3, resolve_kwargs_c.c 5). Authorization chain: - W25 spec §3 Step B: theologian L2017 - 4-step revised sequencing + B-0 endorsement: theologian L2170 - QUERY-BEFORE-PIVOT: generalist L2168 → theologian L2170 ack - Supervisor delegation to theologian: chat L2169
1 parent 911e173 commit d0e8031

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Python/jit/hir/cfg.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
#include "cinderx/Jit/hir/cfg.h"
44
#include "cinderx/Jit/hir/hir_basic_block_c.h"
5-
6-
extern "C" size_t hir_cfg_get_rpo_c(void *cfg, void **out, size_t capacity);
5+
#include "cinderx/Jit/hir/hir_cfg_rpo_c.h"
76

87
namespace jit::hir {
98

0 commit comments

Comments
 (0)