aboutsummaryrefslogtreecommitdiff
path: root/src/entity.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-10-08 12:27:03 +0100
committerGinger Bill <bill@gingerbill.org>2017-10-08 12:27:03 +0100
commit4e42d7df4303470dec5b3c354a9469699f6abf8d (patch)
treede88a4b917a9f7d29b34e2db03a50d05f299b666 /src/entity.cpp
parent580ee5cc4afb6ee15785e57747559d885af16d55 (diff)
Minor code reorganization
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
index 2b0b0c379..b4ffc300b 100644
--- a/src/entity.cpp
+++ b/src/entity.cpp
@@ -2,7 +2,6 @@ struct Scope;
struct Checker;
struct Type;
struct DeclInfo;
-// typedef enum BuiltinProcId BuiltinProcId;
#define ENTITY_KINDS \
@@ -51,15 +50,9 @@ enum EntityFlag {
// Zero value means the overloading process is not yet done
enum OverloadKind {
- Overload_Unknown,
- Overload_No,
- Overload_Yes,
-};
-
-enum EntityAliasKind {
- EntityAlias_Invalid,
- EntityAlias_Type,
- EntityAlias_Entity,
+ Overload_Unknown = 0,
+ Overload_No = 1,
+ Overload_Yes = 2,
};
@@ -99,7 +92,7 @@ struct Entity {
String link_name;
} Variable;
struct {
- bool is_type_alias;
+ bool is_type_alias;
Type *type_parameter_specialization;
} TypeName;
struct {
@@ -129,7 +122,7 @@ struct Entity {
} LibraryName;
i32 Nil;
struct {
- String name;
+ String name;
AstNode *node;
} Label;
};
@@ -268,8 +261,7 @@ Entity *make_entity_library_name(gbAllocator a, Scope *scope, Token token, Type
Entity *make_entity_nil(gbAllocator a, String name, Type *type) {
- Token token = make_token_ident(name);
- Entity *entity = alloc_entity(a, Entity_Nil, nullptr, token, type);
+ Entity *entity = alloc_entity(a, Entity_Nil, nullptr, make_token_ident(name), type);
return entity;
}