w6a: drop chained-ptr-write workaround (c5f30f2 unblocked it)
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user