diff options
| author | 2023-06-29 09:59:30 +0200 | |
|---|---|---|
| committer | 2023-06-29 09:59:30 +0200 | |
| commit | f453b313f62ba42d748f00628be7b3750c797c86 (patch) | |
| tree | e654029d425dee2adf30c0fa2adba31d0266db1c /c.h | |
| parent | 3b96204593b9812674126bad8de14419009682c8 (diff) | |
add initializers (only static for initialier list rn)
and other fixes
Diffstat (limited to 'c.h')
| -rw-r--r-- | c.h | 34 |
1 files changed, 33 insertions, 1 deletions
@@ -38,11 +38,43 @@ struct expr { uvlong u; vlong i; double f; /* ENUMLIT */ struct bytes s; /* ESTRLIT */ struct decl *sym; /* ESYM */ - struct initializer *ini; /* EINIT */ + struct init *init; /* EINIT */ + }; +}; + +struct init { + uint n; + struct bitset *zero; + uint *offs; + struct { uchar off, siz; } *bitf; + struct expr **ex; +}; + +enum storageclass { + SCNONE, + SCTYPEDEF = 1<<0, + SCEXTERN = 1<<1, + SCSTATIC = 1<<2, + SCTHREADLOCAL = 1<<3, + SCAUTO = 1<<4, + SCREGISTER = 1<<5, +}; + +struct decl { + union type ty; + uchar scls; + uchar qual : 2; + uchar isenum : 1; + struct span span; + const char *name; + union { + struct { ushort align; int id; }; + vlong value; }; }; enum evalmode { + EVNONE, EVINTCONST, EVARITH, EVSTATICINI, |