aboutsummaryrefslogtreecommitdiff
path: root/all.h
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2017-04-08 21:09:59 -0400
committerQuentin Carbonneaux <[email protected]>2017-04-08 21:57:05 -0400
commit96836855a55cd28f1449b4a58d1e5301669350c0 (patch)
tree3b0688d1b63f528d41edba87232e5469d95d08cb /all.h
parent49a4593c335126ba279f47328824abfef379725e (diff)
rework storage of types
The arm64 ABI needs to know precisely what floating point types are being used, so we need to store that information. I also made typ[] a dynamic array.
Diffstat (limited to 'all.h')
-rw-r--r--all.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/all.h b/all.h
index c0e08fe..8cbec63 100644
--- a/all.h
+++ b/all.h
@@ -26,7 +26,7 @@ typedef struct Con Con;
typedef struct Addr Mem;
typedef struct Fn Fn;
typedef struct Typ Typ;
-typedef struct Seg Seg;
+typedef struct Field Field;
typedef struct Dat Dat;
typedef struct Target Target;
@@ -35,8 +35,7 @@ enum {
NPred = 63,
NIns = 8192,
NAlign = 3,
- NSeg = 32,
- NTyp = 128,
+ NField = 32,
NBit = CHAR_BIT * sizeof(bits),
};
@@ -353,18 +352,22 @@ struct Typ {
char name[NString];
int dark;
int align;
- size_t size;
- int nunion;
- struct Seg {
+ uint64_t size;
+ uint nunion;
+ struct Field {
enum {
- SEnd,
- SPad,
- SInt,
- SFlt,
- STyp,
+ FEnd,
+ Fb,
+ Fh,
+ Fw,
+ Fl,
+ Fs,
+ Fd,
+ FPad,
+ FTyp,
} type;
- uint len; /* index in typ[] for Styp */
- } (*seg)[NSeg+1];
+ uint len; /* or index in typ[] for FTyp */
+ } (*fields)[NField+1];
};
struct Dat {
@@ -404,7 +407,7 @@ typedef enum {
Pfn, /* discarded after processing the function */
} Pool;
-extern Typ typ[NTyp];
+extern Typ *typ;
extern Ins insb[NIns], *curi;
void die_(char *, char *, ...) __attribute__((noreturn));
void *emalloc(size_t);