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:
@@ -1049,7 +1049,7 @@ fn cgcast(c: *cgen, n: *syntax.node) void = {
|
||||
else { if (lk == syntax.nkind.N_TENUM) { leaf_tn = leaf_tn.lhs; }
|
||||
else { if (lk == syntax.nkind.N_TNAME) {
|
||||
let lnm: str = leaf_tn.str;
|
||||
// primsize-ok (#101/#109): this IS an alias chase loop
|
||||
// This is an alias chase loop
|
||||
// — primsize is the leaf-primitive break test the loop
|
||||
// wraps (aliaslookup advances the cursor on a miss).
|
||||
if (primsize(lnm) > 0) { break; };
|
||||
@@ -8936,7 +8936,7 @@ fn cgassign(c: *cgen, n: *syntax.node) void = {
|
||||
else { if (syntax.streq(pe.str, "f64")) { elemfloat = true; }
|
||||
else { if (syntax.streq(pe.str, "f32")) { elemfloat = true; elemf32 = true; }
|
||||
else {
|
||||
// primsize-ok (#101/#109): this site OWNS its own ps==0
|
||||
// This site owns its own ps==0
|
||||
// typenodeprimresolved chase below — routing through
|
||||
// aliasprimsize would double-resolve and regress #11.
|
||||
let ps: i32 = primsize(pe.str);
|
||||
@@ -13174,5 +13174,3 @@ fn cgassign(c: *cgen, n: *syntax.node) void = {
|
||||
// The tail goes loud for the remaining kinds with #22.
|
||||
return;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -3664,7 +3664,7 @@ fn paramfieldsize(t: *syntax.node) i32 = {
|
||||
if (k == syntax.nkind.N_TNAME) {
|
||||
let nm: str = t.str;
|
||||
if (syntax.streq(nm, "str")) { return primtypesize("str"): i32; };
|
||||
// primsize-ok (#101/#109): paramfieldsize is a STRUCTURAL
|
||||
// paramfieldsize is a STRUCTURAL
|
||||
// (no-`c`, no-chase) sizer by design — it takes a *node, not a
|
||||
// *cgen, so it cannot run aliasprimsize's aliaslookup chase
|
||||
// (threading c is the dormant #110). A bare primsize is correct
|
||||
|
||||
@@ -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; };
|
||||
|
||||
@@ -1254,7 +1254,7 @@ fn primtypesize(nm: str) i64 = {
|
||||
// #43: SSoT for slice header size (ptr+len+cap = 24B today). Mirrors
|
||||
// cstage cmd/wcc/type.c:103 (ty_slice->size = 24). Bumping a slice's
|
||||
// header layout in #34 touches only this constant.
|
||||
fn tyslicesize() i64 = { return 24i64; }; // sizelint-ok: SSoT for ty_slice header (#64)
|
||||
fn tyslicesize() i64 = { return 24i64; };
|
||||
|
||||
// #42: AST-level layout helpers for the size(T)/align(T)/offset(e.f)
|
||||
// fold. Mirror cstage resolve_type's size/align computation
|
||||
@@ -2226,9 +2226,6 @@ fn tinfofornode(c: *checker, n: *syntax.node) *syntax.tinfo = {
|
||||
under = c.tc.tyerr;
|
||||
};
|
||||
named.resolving = 0;
|
||||
// peellint-ok: construction — the one
|
||||
// WRITE that builds the NAMED link;
|
||||
// not a peel, can't route via tichase.
|
||||
named.under = under;
|
||||
if (under != nil) {
|
||||
named.size = under.size;
|
||||
@@ -2663,7 +2660,7 @@ fn unifyarith(c: *checker, e: *syntax.node, ltn: *syntax.node, rtn: *syntax.node
|
||||
// agree. Mirrors cstage unify_arith (cmd/wcc/check.c:1060-1067) and
|
||||
// harec type_promote (ref/harec/src/check.c:1083-1105). The error
|
||||
// axis (varianterr) must agree on both sides so a `!i32` alias does
|
||||
// NOT promote against a plain i32 (#246, 949_errtype_compare).
|
||||
// NOT promote against a plain i32 (#246, r949_errtype_* fixtures).
|
||||
// A user alias is an SK_TYPE sym WITH a decl body; the primitives are
|
||||
// SK_TYPE too but decl == nil (check.ww:95-112), so aliassym alone
|
||||
// would mis-flag i32 as "named". This decl != nil gate is the wwstage
|
||||
|
||||
Reference in New Issue
Block a user