parse,check,type,wwi: @packed struct attribute, both stages (#51)
Hare/harec @packed struct layout: no inter-field or trailing padding, align =
max field align (NOT forced to 1) — matches harec type_store.c + types.c:621
(packed{u8,u64}=size 9/align 8). Parser consumes inline @packed (loud-rejects
unknown struct attrs, both stages); layout gates padding on !packed; cstage
type_eq enforces packed type-distinctness; the .wwi producer round-trips
"struct @packed {". wwstage sets slotsize=size for packed so its composite-ABI
copy matches cstage byte-for-byte. cstage identity is faithful; wwstage identity
rides the deferred #224 nominal-resolvealias arc (#108). Both stages byte-id;
447 tests pass.
This commit is contained in:
@@ -345,6 +345,8 @@ struct Node {
|
||||
Node *next; /* sibling link inside `list` */
|
||||
Node *attr; /* @attribute chain (N_ATTR list) */
|
||||
int export;
|
||||
int packed; /* N_TSTRUCT: `struct @packed` — no field/
|
||||
* trailing padding (harec ast.h:95). */
|
||||
Type *type; /* filled in by checker */
|
||||
const char *tsuffix; /* typed numeric literal suffix */
|
||||
const char *module; /* `// MODULE: foo` directive at the
|
||||
@@ -487,6 +489,8 @@ struct Type {
|
||||
* stored as a single 8-byte pointer; null
|
||||
* is the void variant. Mirrors Hare's
|
||||
* `(*T | null)` folding. */
|
||||
int packed; /* TY_STRUCT laid out with no padding; part
|
||||
* of type identity (harec types.c:517/621). */
|
||||
};
|
||||
|
||||
extern Type *ty_void, *ty_bool, *ty_rune;
|
||||
|
||||
Reference in New Issue
Block a user