Commit 47f3170
committed
W25 Step B-77a: function-scoped extern cleanup (98 deleted)
Per W25 spec §3 Step B + theologian [chat L2351] reframing — function-
scoped externs ARE drift class for canonicalization purposes. Same
principle as file-scope: per-helper extern goes stale if canonical
signature changes. Honest framing: this is Step B continuation, NOT
Step C-prelude.
PER-EXTERN CLASSIFICATION (per spec §3 4-class taxonomy):
Class A (in hir_c_api.h, deleted): 40 unique
Class C2 IC (in hir_instr_c.h, deleted): 5 unique
Class C2 cfg_rpo (in hir_cfg_rpo_c.h, deleted): 1 unique (hir_cfg_get_rpo_c)
Class C1 promoted (this commit): 2
hir_bb_in_edges_list → hir_basic_block_c.h
hir_cfg_split_critical_edges_c → hir_c_api.h
TOTAL: 48 unique functions across 98 lint-pattern extern lines
(multi-line continuations + per-helper redeclarations account for
98 lines vs 48 unique)
CHANGES (+8/-125):
hir_basic_block_c.h +4 (hir_bb_in_edges_list decl + comment)
hir_c_api.h +4 (hir_cfg_split_critical_edges_c decl + comment)
simplify_c.c -118 (91 function-scoped externs deleted, mostly hir_c_create_*
in emit_* helpers; canonical decls now visible via #include hir_c_api.h
added in B-5)
pass_output_type_c.c -3 (3 function-scoped externs deleted)
refcount_env_bridge.cpp -3 (extern "C" + 2 function-scoped deleted;
canonical decls visible via hir_c_api.h)
refcount_insertion.cpp -1 (extern "C" hir_cfg_split_critical_edges_c
deleted; canonical decl now in hir_c_api.h via this commit's promotion)
VERIFICATION at HEAD post-commit:
$ grep -rcE '^[[:space:]]*extern[[:space:]]+.*hir_(c_|cfg_|block_|bb_|edge_|func_|instr_)' \
Python/jit/hir/ --include='*.c' --include='*.cpp' \
--exclude='hir_c_api.h' --exclude='hir_basic_block_c.h' --exclude='builder.cpp'
→ 0 violators (zero lint-pattern externs at file-scope OR function-scope)
CUMULATIVE post-77a: ALL §1b + lint-pattern drift surface cleaned across
9 TUs (cfg.cpp + ssaify_c.c + licm_c.c + resolve_kwargs_c.c +
hir_basic_block_c.c + pass_output_type_c.c + simplify_c.c +
builder_emit_c.c + refcount_env_bridge.cpp + refcount_insertion.cpp).
293 lint externs cleaned cumulative (195 file-scope + 98 function-scope).
Step B FORMAL CLOSURE: file-scope (push 75 ab07641) + function-scope
(this commit) = full lint-pattern drift surface CLOSED. Step C lint
gate (push 77b) at clean baseline next.
testkeeper STRICT verify (CLAUDE.md ba00817 + ad9d610 hardened
gate items 1-6) requested post-commit. Wait-for-tree-clean per L2293
operational guidance.
FULL-SCRUTINY scope per gatekeeper [chat L2353]: 98-line blast across
4 TUs + 2 header decl additions + 2 promotions.
Authorization chain:
- W25 spec §3 + 4-class taxonomy: theologian L2017 + L2189 + L2351
- Function-scoped reframing as Step B continuation: theologian L2351
- Option (i) split (77a clean + 77b lint gate): theologian L2351
- Pre-apply ACK: generalist L23541 parent 74bf7fc commit 47f3170
6 files changed
Lines changed: 8 additions & 125 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
705 | 709 | | |
706 | 710 | | |
707 | 711 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
874 | 874 | | |
875 | 875 | | |
876 | 876 | | |
877 | | - | |
878 | 877 | | |
879 | 878 | | |
880 | 879 | | |
| |||
938 | 937 | | |
939 | 938 | | |
940 | 939 | | |
941 | | - | |
942 | 940 | | |
943 | 941 | | |
944 | 942 | | |
| |||
1020 | 1018 | | |
1021 | 1019 | | |
1022 | 1020 | | |
1023 | | - | |
1024 | 1021 | | |
1025 | 1022 | | |
1026 | 1023 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| |||
81 | 79 | | |
82 | 80 | | |
83 | 81 | | |
84 | | - | |
85 | 82 | | |
86 | 83 | | |
87 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
0 commit comments