aboutsummaryrefslogtreecommitdiffhomepage
path: root/c.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2023-06-29 09:59:30 +0200
committerlemon <lsof@mailbox.org>2023-06-29 09:59:30 +0200
commitf453b313f62ba42d748f00628be7b3750c797c86 (patch)
treee654029d425dee2adf30c0fa2adba31d0266db1c /c.h
parent3b96204593b9812674126bad8de14419009682c8 (diff)
add initializers (only static for initialier list rn)
and other fixes
Diffstat (limited to 'c.h')
-rw-r--r--c.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/c.h b/c.h
index 6cdde09..33eef54 100644
--- a/c.h
+++ b/c.h
@@ -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,