aboutsummaryrefslogtreecommitdiff
path: root/src/cffc.hff
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-20 11:06:38 +0200
committerlemon <lsof@mailbox.org>2022-08-20 11:06:38 +0200
commit46e1f128fd310bd29a2b4335b36c60d6cc0aa3a7 (patch)
treefeb93a69cf93773d0542435ae09c76de04e509c8 /src/cffc.hff
parentdf41a4512932f1312e4725d0409757a683b091ed (diff)
initial work on IR
Diffstat (limited to 'src/cffc.hff')
-rw-r--r--src/cffc.hff10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cffc.hff b/src/cffc.hff
index abc00ae..e10602d 100644
--- a/src/cffc.hff
+++ b/src/cffc.hff
@@ -20,7 +20,7 @@ struct Loc {
enum TokT : i32 {
// !sorted
kw_alignof, kw_and, kw_as, kw_break, kw_case, kw_const,
- kw_continue, kw_def, kw_defmacro, kw_do,
+ kw_continue, kw_def, kw_defer, kw_defmacro, kw_do,
kw_else, kw_enum, kw_extern, kw_fn,
kw_for, kw_if, kw_import, kw_let, kw_offsetof,
kw_or, kw_return, kw_sizeof, kw_static,
@@ -118,8 +118,10 @@ struct Type {
struct Fn;
struct Expan;
+struct IRCtx;
struct Parser {
fp *FILE,
+ irctx *IRCtx,
alloc *Allocator,
tlalloc *Allocator,
curfile *const u8,
@@ -433,3 +435,9 @@ extern fn envfree(*Env) void;
// fold.cff
extern fn fold(*Expr) bool;
+
+// ir*.cff
+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;