From f931b089d5ce0374e36c3241176e4ef24953522e Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Thu, 18 Aug 2016 15:58:36 +0100 Subject: print_(f32|f64) --- src/checker/entity.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'src/checker/entity.cpp') diff --git a/src/checker/entity.cpp b/src/checker/entity.cpp index bd784bc4d..182bc1916 100644 --- a/src/checker/entity.cpp +++ b/src/checker/entity.cpp @@ -7,7 +7,6 @@ enum BuiltinProcId; ENTITY_KIND(Constant), \ ENTITY_KIND(Variable), \ ENTITY_KIND(TypeName), \ - ENTITY_KIND(AliasName), \ ENTITY_KIND(Procedure), \ ENTITY_KIND(Builtin), \ ENTITY_KIND(Count), @@ -38,16 +37,14 @@ struct Entity { isize order; union { - struct { ExactValue value; } constant; + struct { ExactValue value; } Constant; struct { b8 visited; b8 is_field; b8 used; - } variable; - struct {} type_name; - struct {} alias_name; - struct {} procedure; - struct { BuiltinProcId id; } builtin; + } Variable; + struct { b8 used; } Procedure; + struct { BuiltinProcId id; } Builtin; }; }; @@ -74,7 +71,7 @@ Entity *make_entity_variable(gbAllocator a, Scope *parent, Token token, Type *ty Entity *make_entity_constant(gbAllocator a, Scope *parent, Token token, Type *type, ExactValue value) { Entity *entity = alloc_entity(a, Entity_Constant, parent, token, type); - entity->constant.value = value; + entity->Constant.value = value; return entity; } @@ -83,20 +80,15 @@ Entity *make_entity_type_name(gbAllocator a, Scope *parent, Token token, Type *t return entity; } -Entity *make_entity_alias_name(gbAllocator a, Scope *parent, Token token, Type *type) { - Entity *entity = alloc_entity(a, Entity_AliasName, parent, token, type); - return entity; -} - Entity *make_entity_param(gbAllocator a, Scope *parent, Token token, Type *type) { Entity *entity = make_entity_variable(a, parent, token, type); - entity->variable.used = true; + entity->Variable.used = true; return entity; } Entity *make_entity_field(gbAllocator a, Scope *parent, Token token, Type *type) { Entity *entity = make_entity_variable(a, parent, token, type); - entity->variable.is_field = true; + entity->Variable.is_field = true; return entity; } @@ -107,7 +99,7 @@ Entity *make_entity_procedure(gbAllocator a, Scope *parent, Token token, Type *s Entity *make_entity_builtin(gbAllocator a, Scope *parent, Token token, Type *type, BuiltinProcId id) { Entity *entity = alloc_entity(a, Entity_Builtin, parent, token, type); - entity->builtin.id = id; + entity->Builtin.id = id; return entity; } -- cgit v1.2.3