comments: drop retired lint markers, re-cite migrated carriers

peel-ok/sizelint-ok/primsize-ok annotations lose their tools; sites
keep the WHY in plain words. Citations of retired carriers move to
their fixture or @test successors (949_errtype_compare -> r949_*,
900_stdlib -> library owners).
This commit is contained in:
2026-08-07 23:03:55 +09:00
parent 228a632a2f
commit 90dc6369c9
12 changed files with 61 additions and 81 deletions

View File

@@ -1600,16 +1600,12 @@ fn elemisarrayc(c: *cgen, t: *syntax.node) bool = {
return elem.kind == syntax.nkind.N_TARRAY;
};
// tichase — transitive TY_NAMED peel, nil-passthrough. Exact wwstage
// twin of cstage type_chase_named (cmd/wcc/type.c:160-162, alias arc
// #5): chain-of-aliases stacks TY_NAMED layers, so any single peel
// leaves a kind-gated consumer staring at TY_NAMED and falling to a
// scalar shape (#60's esz=1/pointer-base SEGV family). One chased
// accessor is the only spelled way to dealias; raw `.under` reads
// outside it are the lint target (rob F2 ruling).
// tichase is the wwstage twin of cstage type_chase_named
// (cmd/wcc/type.c:160-162, alias arc #5). Alias chains stack TY_NAMED
// layers, so consumers that need structural shape must resolve the whole
// chain or risk the scalar fallback (#60's esz=1/pointer-base family).
fn tichase(t0: *syntax.tinfo) *syntax.tinfo = {
let t: *syntax.tinfo = t0;
// peel-ok: chase body
for (t != nil && t.kind == syntax.tykind.TY_NAMED) { t = t.under; };
return t;
};
@@ -1796,7 +1792,7 @@ fn elemsizeof(t: *syntax.node) i32 = {
// reads eff->sub->size (cmd/w6c/cgen.c N_INDEX).
if (syntax.streq(nm, "str")) { return primtypesize("u8"): i32; };
// Indexing a primitive name (rare): element size = the prim.
// primsize-ok (#101/#109): elemsizeof is the STRUCTURAL (non-
// elemsizeof is the STRUCTURAL (non-
// chasing) sizer by design — its alias-resolving twin elemsizeofc
// owns the chase (routed through aliasprimsize at the :1579 leg).
// A bare primsize here is correct, not the #101 bug shape.
@@ -1824,7 +1820,7 @@ fn elemsizeof(t: *syntax.node) i32 = {
let nm: str = elem.str;
// str element is 16B (ptr+len). primsize returns 0 for it.
if (syntax.streq(nm, "str")) { return primtypesize("str"): i32; };
// primsize-ok (#101/#109): structural sizer — the chase lives
// This structural sizer leaves alias resolution
// in elemsizeofc (:1579), not here. See the :1475 leg.
let ps: i32 = primsize(nm);
if (ps > 0) { return ps; };
@@ -2427,9 +2423,8 @@ fn fldnumidx(s: str) i32 = {
return r;
};
// primsize-ok (#101/#109): the primitive-width oracle itself — this
// IS the SSoT table aliasprimsize wraps; there is nothing below it to
// chase.
// This primitive-width oracle is the SSoT table aliasprimsize wraps;
// there is nothing below it to chase (#101/#109).
fn primsize(name: str) i32 = {
if (syntax.streq(name, "u8")) { return 1; };
if (syntax.streq(name, "i8")) { return 1; };
@@ -2463,8 +2458,8 @@ fn primsize(name: str) i32 = {
// at the twin sites; this is the ww align-up. The bare-primsize GUARD
// family (is-primitive dispatch) is the #109 follow-on, NOT routed
// here. #101.
// primsize-ok (#101/#109): the SSoT chase body itself — primsize is
// the leaf-primitive probe this helper wraps, then aliaslookup chases.
// primsize is the leaf-primitive probe this SSoT helper wraps, then
// aliaslookup chases (#101/#109).
fn aliasprimsize(c: *cgen, nm: str) i32 = {
let ps: i32 = primsize(nm);
if (ps > 0) { return ps; };
@@ -2506,7 +2501,7 @@ export fn typenodeprimresolved(c: *cgen, t: *syntax.node,
// dedicated `is_bool` path in cgcast owns bool→bool's
// ANDQ $255 on both stages.
if (syntax.streq(nm, "bool")) { return; };
// primsize-ok (#101/#109): this fn IS a prim-resolver
// This function is a primitive resolver
// chaser (#33) — primsize is the leaf-primitive probe;
// aliaslookup below advances the walk on a miss.
let ps: i32 = primsize(nm);
@@ -2546,7 +2541,7 @@ export fn exprprimresolved(c: *cgen, n: *syntax.node,
// mymode;` (mymode = enum u32).
let s: str = n.tsuffix;
if (s.len > 0) {
// primsize-ok (#101/#109): a typed-int literal suffix
// A typed-int literal suffix
// (`7u32`) is a builtin primitive name by grammar — no
// alias can reach here, so there is nothing to chase.
let ps: i32 = primsize(s);
@@ -3110,8 +3105,8 @@ fn taggedmemargsize(t: *syntax.tinfo) i32 = {
if (u == nil) { return 0; };
if (u.kind != syntax.tykind.TY_TAGGED) { return 0; };
if (u.nullable != 0) { return 0; };
// sizelint-ok: 6 SysV int arg regs (DI..R9) x 8B words — the
// same register-capacity constant as cstage tagged_arg_size.
// SysV supplies 6 integer argument registers (DI..R9); the 8-byte
// words below encode the same capacity as cstage tagged_arg_size.
if (u.size: i32 <= 6 * 8) { return 0; };
return u.size: i32;
};
@@ -3325,10 +3320,10 @@ export fn nullableptrtag(t: *syntax.node) i32 = {
for (p != nil) {
let vt: *syntax.tinfo = p.type_;
if (vt != nil) {
// peel-ok: single peel PROBE-CLEARED (batch-2 c3-B2,
// 018ef66) constructible variant params never carry
// 2+-level NAMED at this scan; cs twin nullable_ptr_tag
// (cmd/w6c/cgen.c:747) keeps the identical single peel.
// A single-level inspection is sufficient here (batch-2
// c3-B2, 018ef66): constructible variant params never carry
// nested NAMED layers at this scan; the cs twin relies on
// the same invariant.
if (vt.kind == syntax.tykind.TY_NAMED) { vt = vt.under; };
if (vt != nil) {
if (vt.kind == syntax.tykind.TY_PTR) { return i; };