aboutsummaryrefslogtreecommitdiff
path: root/src/cffc.hff
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-21 06:57:48 +0200
committerlemon <lsof@mailbox.org>2022-08-21 06:57:48 +0200
commit135e66c64adf0ef5d2723c243d2f2f6a059ae753 (patch)
tree7fa932722f75534c8492dd776096fc71a1412edc /src/cffc.hff
parentfa8aaba64d206330959470e1ffbf0ad0c974456a (diff)
asm prelude, more IR
Diffstat (limited to 'src/cffc.hff')
-rw-r--r--src/cffc.hff15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/cffc.hff b/src/cffc.hff
index 31af5fb..c8e3f11 100644
--- a/src/cffc.hff
+++ b/src/cffc.hff
@@ -321,6 +321,14 @@ struct DeclList {
decl Decl,
}
+
+struct Backend {
+ impl *void,
+ initf *fn(*Backend, *FILE) void,
+ genstaticf *fn(*Backend, *Decl) void,
+ genfnf *fn(*Backend, *Fn) void,
+}
+
struct Targ {
name *const u8,
ptrsize u8,
@@ -333,6 +341,8 @@ struct Targ {
valistsize u8, valistalign u8,
charsigned bool,
shortenum bool,
+
+ B *Backend,
}
// parse.cff
@@ -351,7 +361,7 @@ extern fn err(P *Parser, Loc, fmt *const u8, ...) void;
extern fn fatal(*Parser, Loc, fmt *const u8, ...) void;
// targ.cff
-extern static g_targ *const Targ;
+extern static g_targ Targ;
extern fn targ_ini(name *const u8) bool;
// type.cff
@@ -443,3 +453,6 @@ extern fn mkirctx(*Allocator) *IRCtx;
extern fn ir_genstatic(*IRCtx, *Decl) void;
extern fn ir_genfn(*IRCtx, *Fn) void;
extern fn ir_free(*IRCtx) void;
+
+// asm.cff
+extern static g_asmbackend Backend;