From a4ddca68662f4bc0531763357b4bc00b6c50b456 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 13 Aug 2022 13:00:37 +0200 Subject: target --- src/all.hff | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'src/all.hff') diff --git a/src/all.hff b/src/all.hff index ff74ab7..63ca996 100644 --- a/src/all.hff +++ b/src/all.hff @@ -90,20 +90,17 @@ struct Type { align usize, konst bool, id uint, - t enum union { - void, - bool, - int struct { sgn bool }, - flo, - ptr *Type, - arr struct { child *Type, length i64 }, - slice *Type, + u enum union { + Void, + Bool, + Int struct { sgn bool }, + Flo, + Ptr *Type, + Arr struct { child *Type, length i64 }, + Slice *Type, } } -struct Decl { -} - struct Parser { fp *FILE, curfile *const u8, @@ -115,6 +112,19 @@ struct Parser { } +struct Targ { + name *const u8, + ptrsize u8, + intsize u8, + longsize u8, longalign u8, + llongsize u8, llongalign u8, + sizesize u8, + f64align u8, + valistsize u8, valistalign u8, + charsigned bool, + shortenum bool, +} + // parse.cff extern fn parser_init(*Parser, path *const u8) void; extern fn parse(*Parser) [#]Decl; @@ -127,6 +137,7 @@ extern fn xstrdup(str *const u8) *u8; def FNV1A_INI u32 = 0x811c9dc5; extern fn fnv1a(h u32, [#]const u8) u32; extern fn fnv1a_s(h u32, *const u8) u32; +extern fn fnv1a_i(h u32, i64) u32; extern fn addfilepath(*const u8) int; extern fn fatal(*Parser, Loc, fmt *const u8, ...) void; extern fn internstr(*const u8) *const u8; @@ -137,6 +148,12 @@ extern fn pfmt(proc *fn(u8, *void) void, parg *void, fmt *const u8, ...) void; extern fn vefmt(fmt *const u8, ap va_list) void; extern fn efmt(fmt *const u8, ...) void; +// type.cff + +// targ.cff +extern static g_targ *const Targ; +extern fn targ_ini(name *const u8) bool; + // Inline functions fn bswap32(x u32) u32 { return (x >> 24) -- cgit v1.2.3