From d74ed7fb65bf7ac245d2548ac13f3f3fdabadd16 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 22 Aug 2022 17:47:02 +0200 Subject: llvm hello worlding --- src/type.cff | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/type.cff') diff --git a/src/type.cff b/src/type.cff index ddb4cd8..194ff01 100644 --- a/src/type.cff +++ b/src/type.cff @@ -115,14 +115,13 @@ struct TypeTraits { } } +static types_set Set<*const Type, TypeTraits> = {}; extern fn interntype(ty0 Type) *const Type { - static set Set<*const Type, TypeTraits> = {}; - if ty0.align == 0 { ty0.align = ty0.size; } - return *set->intern(&ty0); + return *types_set->intern(&ty0); } extern fn completetype(ty *const Type) bool { @@ -307,3 +306,9 @@ extern fn typeof2(a *const Type, b *const Type) *const Type { } return #null; } + +extern fn types_to_llvm() void { + set_each(ty, types_set) { + llvm_addtype(ty); + } +} -- cgit v1.2.3