diff options
| -rw-r--r-- | c/c.h | 14 | ||||
| -rw-r--r-- | ir/ir.h | 2 | ||||
| -rw-r--r-- | type.h | 1 |
3 files changed, 11 insertions, 6 deletions
@@ -25,16 +25,18 @@ enum exprkind { struct expr { uchar t; uchar qual; - ushort narg; /* ECALL */ union type ty; struct span span; union { struct { - struct expr *sub; - struct exgetfld { - ushort off; - uchar bitsiz, bitoff; - } fld; /* EGETF */ + struct expr *sub; /* child(ren) */ + union { + struct exgetfld { + ushort off; + uchar bitsiz, bitoff; + } fld; /* EGETF */ + ushort narg; /* ECALL */ + }; }; uvlong u; vlong i; double f; /* ENUMLIT */ struct { @@ -68,6 +68,7 @@ union ref { struct { unsigned t : 3; signed i : 29; }; uint bits; }; +static_assert(sizeof(union ref) == 4); struct addr { union ref base, index; @@ -115,6 +116,7 @@ struct instr { uchar reg; /* 0 -> no reg; else reg + 1 */ union ref l, r; /* args */ }; +static_assert(sizeof(struct instr) == 4*3); enum jumpkind { JXXX, Jb, Jret, Jtrap, }; @@ -44,6 +44,7 @@ union type { }; uint bits; }; +static_assert(sizeof(union type) == 4); #define isprimt(t) in_range((t), TYBOOL, TYVOID) #define isintt(t) in_range((t), TYENUM, TYUVLONG) |