lib/ww + wcc + w6c + wwdump: strip *arena cascade (γ-6)

amalloc has 0 callers post-γ-2; the *arena threaded through
newnode/newscope/newtype/prim/typesinit/type{ptr,slice,array,chan,
named}/lexinit/parserinit/joindotted/checkinit/arenau64tos/cgeninit
and the scope.a / tctx.a / lex.a / parser.a / checker.a / cgen.a
fields are vestigial.

Drop `import mem;` from 15 files, remove six struct fields, strip
*arena from 14 signatures, update ~120 call sites across lib/ww +
wcc + w6c + wwdump. selfhost/test/sym_link.ww fixture drops the
newarena/freearena probe; still exits 42 on scopedefine/scopelookup.
Both main.combined.ww auto-regenerated.

Comments retidied: typ.ww "once per arena" → "once per program";
parse.ww drops "arena-build" qualifier on joindotted; sym.ww drops
mem-sibling-imports rationale.

Verified 132/132 incl. 994_w6c_ww + 995_self_rebuild byte-identity
(the primary symmetric-stages gate).
This commit is contained in:
2026-05-21 13:01:57 +09:00
parent f83e65b82a
commit 353dffb5e8
19 changed files with 543 additions and 824 deletions

View File

@@ -25,7 +25,6 @@
package wcc;
import os;
import mem;
import ast;
import tok;
import typ;
@@ -68,9 +67,9 @@ fn collectaliases(c: *cgen, file: *node) void = {
// same-module / any-match passes in aliaslookup then let a local
// `type nomem = !void;` shadow this fallback within its module.
let empty: str;
let tnvoid: *node = newnode(c.a, nkind.N_TNAME, empty, 0, 0);
let tnvoid: *node = newnode(nkind.N_TNAME, empty, 0, 0);
tnvoid.str = "void";
let bang: *node = newnode(c.a, nkind.N_TBANG, empty, 0, 0);
let bang: *node = newnode(nkind.N_TBANG, empty, 0, 0);
bang.lhs = tnvoid;
let nomemal: *aliasent = alloc(aliasent{aname="nomem", amod=empty, target=bang, aanext=nil})!;
c.aliases = nomemal;
@@ -435,7 +434,6 @@ def LOOP_MAX: i32 = 16;
def DEFER_MAX: i32 = 16;
type cgen = struct {
a: *arena,
locals: *local,
// atlocals — persistent registry of `@`-prefix scratch slots
// for the current fn. cgblock save/restores c.locals to scope
@@ -522,8 +520,7 @@ type letvar = struct {
lvnext: *letvar,
};
fn cgeninit(c: *cgen, a: *arena) void = {
c.a = a;
fn cgeninit(c: *cgen) void = {
c.locals = nil;
c.atlocals = nil;
c.frame = 0;