diff --git a/selfhost/cmd/w6c/main.combined.ww b/selfhost/cmd/w6c/main.combined.ww index fa6ea27c..d8ad8c56 100644 --- a/selfhost/cmd/w6c/main.combined.ww +++ b/selfhost/cmd/w6c/main.combined.ww @@ -11221,23 +11221,6 @@ fn nodeisstr(c: *cgen, n: *node) bool = { return false; }; -// typenameisunsigned — primitive-name unsigned check. Kept because -// two call sites (typenodeprimresolved L1729, exprprimresolved L1766) -// have only a raw `str` in scope (TNAME.str / INTLIT.tsuffix), not a -// stamped *node — the typed-AST path doesn't reach them yet (#47 -// A.6.3c). The node-keyed predicates collapsed onto -// typeisunsigned(n.type_: *tinfo) per A.6.3a (#45). -fn typenameisunsigned(nm: str) bool = { - if (streq(nm, "u8")) { return true; }; - if (streq(nm, "u16")) { return true; }; - if (streq(nm, "u32")) { return true; }; - if (streq(nm, "u64")) { return true; }; - if (streq(nm, "uint")) { return true; }; - if (streq(nm, "uintptr")) { return true; }; - if (streq(nm, "rune")) { return true; }; - return false; -}; - // typeis8byteprimitive — does this type take exactly one 8-byte // slot rather than a wider aggregate? One-liner via typeis8byteprim // (cstage N_LET sz==8 ladder SSoT). t.type_ is stamped at check.ww @@ -11969,7 +11952,7 @@ export fn typenodeprimresolved(c: *cgen, t: *node, let ps: i32 = primsize(nm); if (ps > 0) { *sz_out = ps; - *unsigned_out = typenameisunsigned(nm); + *unsigned_out = typeisunsigned(cur.type_: *tinfo); return; }; let al: *node = aliaslookup(c, nm); @@ -12006,7 +11989,7 @@ export fn exprprimresolved(c: *cgen, n: *node, let ps: i32 = primsize(s); if (ps > 0) { *sz_out = ps; - *unsigned_out = typenameisunsigned(s); + *unsigned_out = typeisunsigned(n.type_: *tinfo); }; }; return; diff --git a/selfhost/cmd/wcc/cgenutil.ww b/selfhost/cmd/wcc/cgenutil.ww index 470b8333..ec169e98 100644 --- a/selfhost/cmd/wcc/cgenutil.ww +++ b/selfhost/cmd/wcc/cgenutil.ww @@ -849,23 +849,6 @@ fn nodeisstr(c: *cgen, n: *node) bool = { return false; }; -// typenameisunsigned — primitive-name unsigned check. Kept because -// two call sites (typenodeprimresolved L1729, exprprimresolved L1766) -// have only a raw `str` in scope (TNAME.str / INTLIT.tsuffix), not a -// stamped *node — the typed-AST path doesn't reach them yet (#47 -// A.6.3c). The node-keyed predicates collapsed onto -// typeisunsigned(n.type_: *tinfo) per A.6.3a (#45). -fn typenameisunsigned(nm: str) bool = { - if (streq(nm, "u8")) { return true; }; - if (streq(nm, "u16")) { return true; }; - if (streq(nm, "u32")) { return true; }; - if (streq(nm, "u64")) { return true; }; - if (streq(nm, "uint")) { return true; }; - if (streq(nm, "uintptr")) { return true; }; - if (streq(nm, "rune")) { return true; }; - return false; -}; - // typeis8byteprimitive — does this type take exactly one 8-byte // slot rather than a wider aggregate? One-liner via typeis8byteprim // (cstage N_LET sz==8 ladder SSoT). t.type_ is stamped at check.ww @@ -1597,7 +1580,7 @@ export fn typenodeprimresolved(c: *cgen, t: *node, let ps: i32 = primsize(nm); if (ps > 0) { *sz_out = ps; - *unsigned_out = typenameisunsigned(nm); + *unsigned_out = typeisunsigned(cur.type_: *tinfo); return; }; let al: *node = aliaslookup(c, nm); @@ -1634,7 +1617,7 @@ export fn exprprimresolved(c: *cgen, n: *node, let ps: i32 = primsize(s); if (ps > 0) { *sz_out = ps; - *unsigned_out = typenameisunsigned(s); + *unsigned_out = typeisunsigned(n.type_: *tinfo); }; }; return; diff --git a/selfhost/cmd/wwdump/main.combined.ww b/selfhost/cmd/wwdump/main.combined.ww index 31455ace..69b84bb6 100644 --- a/selfhost/cmd/wwdump/main.combined.ww +++ b/selfhost/cmd/wwdump/main.combined.ww @@ -11221,23 +11221,6 @@ fn nodeisstr(c: *cgen, n: *node) bool = { return false; }; -// typenameisunsigned — primitive-name unsigned check. Kept because -// two call sites (typenodeprimresolved L1729, exprprimresolved L1766) -// have only a raw `str` in scope (TNAME.str / INTLIT.tsuffix), not a -// stamped *node — the typed-AST path doesn't reach them yet (#47 -// A.6.3c). The node-keyed predicates collapsed onto -// typeisunsigned(n.type_: *tinfo) per A.6.3a (#45). -fn typenameisunsigned(nm: str) bool = { - if (streq(nm, "u8")) { return true; }; - if (streq(nm, "u16")) { return true; }; - if (streq(nm, "u32")) { return true; }; - if (streq(nm, "u64")) { return true; }; - if (streq(nm, "uint")) { return true; }; - if (streq(nm, "uintptr")) { return true; }; - if (streq(nm, "rune")) { return true; }; - return false; -}; - // typeis8byteprimitive — does this type take exactly one 8-byte // slot rather than a wider aggregate? One-liner via typeis8byteprim // (cstage N_LET sz==8 ladder SSoT). t.type_ is stamped at check.ww @@ -11969,7 +11952,7 @@ export fn typenodeprimresolved(c: *cgen, t: *node, let ps: i32 = primsize(nm); if (ps > 0) { *sz_out = ps; - *unsigned_out = typenameisunsigned(nm); + *unsigned_out = typeisunsigned(cur.type_: *tinfo); return; }; let al: *node = aliaslookup(c, nm); @@ -12006,7 +11989,7 @@ export fn exprprimresolved(c: *cgen, n: *node, let ps: i32 = primsize(s); if (ps > 0) { *sz_out = ps; - *unsigned_out = typenameisunsigned(s); + *unsigned_out = typeisunsigned(n.type_: *tinfo); }; }; return;