aboutsummaryrefslogtreecommitdiffhomepage
path: root/ir.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 /ir.h
parent3b96204593b9812674126bad8de14419009682c8 (diff)
add initializers (only static for initialier list rn)
and other fixes
Diffstat (limited to 'ir.h')
-rw-r--r--ir.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/ir.h b/ir.h
index 6507fe0..b206550 100644
--- a/ir.h
+++ b/ir.h
@@ -16,19 +16,11 @@ union irtype {
};
struct irdat {
- uchar align : 6, mut : 1, globl : 1;
+ uchar align : 6, globl : 1;
+ uchar section;
uint siz;
- union {
- vec_of(uchar) dat;
- uchar sdat[8];
- };
+ uint off;
const char *name;
- struct symref {
- struct symref *next;
- const char *sym;
- uint off;
- vlong addend;
- } *syms;
};
struct xcon {
@@ -221,13 +213,13 @@ union ref mkfltcon(enum irclass, double);
#define isintcon(r) (iscon(r) && kisint(concls(r)))
#define isfltcon(r) ((r).t == RXCON && kisflt(conht[(r).i].cls))
#define isnumcon(r) ((r).t == RICON || ((r).t == RXCON && conht[(r).i].cls))
+#define isaddrcon(r) ((r).t == RXCON && !conht[(r).i].cls && !conht[(r).i].deref)
#define intconval(r) ((r).t == RICON ? (r).i : conht[(r).i].i)
#define fltconval(r) (conht[(r).i].f)
union ref mksymref(const char *);
union ref mkdatref(const char *name, uint siz, uint align, const void *, uint n, bool deref);
const char *xcon2sym(int ref);
struct instr mkalloca(uint siz, uint align);
-void conputdat(struct irdat *, uint off, enum typetag t, const void *dat);
union ref mkcallarg(union irtype ret, uint narg, int vararg);
#define mkintrin(B, C, N) mkinstr(Ointrin, C, {.t=RICON,B}, mkcallarg((union irtype){{0}},N,-1))
union ref mkaddr(struct addr);