From 46e1f128fd310bd29a2b4335b36c60d6cc0aa3a7 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 20 Aug 2022 11:06:38 +0200 Subject: initial work on IR --- src/cffc.hff | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/cffc.hff') 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; -- cgit v1.2.3