From 44166ec379d325982ebb3f116e56df89dc8aefb4 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sat, 11 Jan 2020 12:51:25 -0500 Subject: changed the way struct names work --- types.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'types.h') diff --git a/types.h b/types.h index 8050c3a..8fd9af1 100644 --- a/types.h +++ b/types.h @@ -389,11 +389,6 @@ typedef struct FnType { Constness *constness; /* [i] = constness of param #i. iff no parameters are constant, this is NULL. don't use it as a dynamic array, because eventually it might not be. */ } FnType; -enum { - STRUCT_DEF_FOUND_OFFSETS = 0x01, - STRUCT_DEF_CGENERATED = 0x02, -}; - enum { TYPE_IS_FLEXIBLE = 0x01, TYPE_IS_RESOLVED = 0x02, @@ -430,14 +425,21 @@ typedef struct Field { size_t offset; /* offset during compile time */ } Field; +enum { + STRUCT_DEF_FOUND_OFFSETS = 0x01, + STRUCT_DEF_CGEN_DECLARED = 0x02, + STRUCT_DEF_CGEN_DEFINED = 0x04 +}; + typedef struct StructDef { Field *fields; Location where; - U16 flags; + U8 flags; size_t size; /* size of this struct during compile time */ size_t align; + Identifier name; struct { - Identifier name; + /* if name is NULL, use this */ IdentID id; } c; struct { -- cgit v1.2.3