From 776dc0e8f1aa506ae0096c78ff10565e56c175e7 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 30 Jul 2016 00:09:30 +0100 Subject: Restart LLVM IR SSA generation This is the third go and I'm going for it! --- src/checker/type.cpp | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'src/checker/type.cpp') diff --git a/src/checker/type.cpp b/src/checker/type.cpp index 3a66b62ac..8dea9c58f 100644 --- a/src/checker/type.cpp +++ b/src/checker/type.cpp @@ -51,21 +51,32 @@ struct BasicType { }; + +#define TYPE_KINDS \ + TYPE_KIND(Invalid), \ + TYPE_KIND(Basic), \ + TYPE_KIND(Array), \ + TYPE_KIND(Slice), \ + TYPE_KIND(Structure), \ + TYPE_KIND(Pointer), \ + TYPE_KIND(Named), \ + TYPE_KIND(Alias), \ + TYPE_KIND(Tuple), \ + TYPE_KIND(Procedure), \ + TYPE_KIND(Count), + enum TypeKind { - Type_Invalid, - - Type_Basic, - Type_Array, - Type_Slice, - Type_Structure, - Type_Pointer, - Type_Named, - Type_Alias, - Type_Tuple, - Type_Procedure, - - Type_Count, +#define TYPE_KIND(k) GB_JOIN2(Type_, k) + TYPE_KINDS +#undef TYPE_KIND }; + +String const type_strings[] = { +#define TYPE_KIND(k) {cast(u8 *)#k, gb_size_of(#k)-1} + TYPE_KINDS +#undef TYPE_KIND +}; + struct Type { TypeKind kind; union { -- cgit v1.2.3