diff --git a/selfhost/cmd/w6a/main.combined.ww b/selfhost/cmd/w6a/main.combined.ww index cdffd1ab..4f9dd1f3 100644 --- a/selfhost/cmd/w6a/main.combined.ww +++ b/selfhost/cmd/w6a/main.combined.ww @@ -449,11 +449,10 @@ type aoperand = struct { asym: str, }; -// `from` and `to` are pointer-to-aoperand (rather than embedded). The -// C cgen we currently bootstrap on doesn't support chained-dot through -// embedded structs (e.g. p.to.atype where `to` is a value field), but -// it does support chained-dot through pointer fields. Allocating each -// operand once per prog lets us write `p.to.atype` straightforwardly. +// `from` and `to` are pointer-to-aoperand (rather than embedded). +// The C cgen doesn't support chained-dot through embedded value +// fields, so allocating each operand once per prog lets us write +// `p.to.atype` directly. type aprog = struct { as_: i32, from: *aoperand, @@ -936,13 +935,7 @@ fn addprog(a: *asm_, opc: i32, lbl: str) *aprog = { pr.from = amalloc(a.a, 48u64): *aoperand; pr.to = amalloc(a.a, 48u64): *aoperand; if (a.head == nil) { a.head = pr; } - else { - // `a.tail.link = pr` would be a chained-dot write through a - // pointer field, which the C cgen we bootstrap on doesn't - // support (silently drops the store). Bind a local first. - let tail: *aprog = a.tail; - tail.link = pr; - }; + else { a.tail.link = pr; }; a.tail = pr; return pr; }; diff --git a/selfhost/cmd/w6a/parse.ww b/selfhost/cmd/w6a/parse.ww index 78cfc6d3..1fb71a48 100644 --- a/selfhost/cmd/w6a/parse.ww +++ b/selfhost/cmd/w6a/parse.ww @@ -354,13 +354,7 @@ fn addprog(a: *asm_, opc: i32, lbl: str) *aprog = { pr.from = amalloc(a.a, 48u64): *aoperand; pr.to = amalloc(a.a, 48u64): *aoperand; if (a.head == nil) { a.head = pr; } - else { - // `a.tail.link = pr` would be a chained-dot write through a - // pointer field, which the C cgen we bootstrap on doesn't - // support (silently drops the store). Bind a local first. - let tail: *aprog = a.tail; - tail.link = pr; - }; + else { a.tail.link = pr; }; a.tail = pr; return pr; }; diff --git a/selfhost/cmd/w6a/types.ww b/selfhost/cmd/w6a/types.ww index ab5e8e17..4ff689b1 100644 --- a/selfhost/cmd/w6a/types.ww +++ b/selfhost/cmd/w6a/types.ww @@ -130,11 +130,10 @@ type aoperand = struct { asym: str, }; -// `from` and `to` are pointer-to-aoperand (rather than embedded). The -// C cgen we currently bootstrap on doesn't support chained-dot through -// embedded structs (e.g. p.to.atype where `to` is a value field), but -// it does support chained-dot through pointer fields. Allocating each -// operand once per prog lets us write `p.to.atype` straightforwardly. +// `from` and `to` are pointer-to-aoperand (rather than embedded). +// The C cgen doesn't support chained-dot through embedded value +// fields, so allocating each operand once per prog lets us write +// `p.to.atype` directly. type aprog = struct { as_: i32, from: *aoperand,