aboutsummaryrefslogtreecommitdiff
path: root/src/checker/entity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/checker/entity.cpp')
-rw-r--r--src/checker/entity.cpp24
1 files changed, 8 insertions, 16 deletions
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;
}