aboutsummaryrefslogtreecommitdiff
path: root/src/entity.c
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-03-12 16:42:51 +0000
committerGinger Bill <bill@gingerbill.org>2017-03-12 16:42:51 +0000
commitaaec8bf423a40f887d43d12403c2e40f187d424c (patch)
tree98958a8c7db53197a0176fcc7607bdcad0a4d8c3 /src/entity.c
parent0fcbda951aea462248304a7e16f5c4eb9da9939d (diff)
windows.odin TYPE_NAME to Type_Name; More SSA work and SSA printing for debugging
Diffstat (limited to 'src/entity.c')
-rw-r--r--src/entity.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/entity.c b/src/entity.c
index 32d070953..446edfa54 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -13,6 +13,7 @@ typedef struct Type Type;
ENTITY_KIND(Builtin) \
ENTITY_KIND(ImportName) \
ENTITY_KIND(LibraryName) \
+ ENTITY_KIND(Alias) \
ENTITY_KIND(Nil) \
ENTITY_KIND(Count)
@@ -95,6 +96,9 @@ struct Entity {
String name;
bool used;
} LibraryName;
+ struct {
+ Entity *original;
+ } Alias;
i32 Nil;
};
};
@@ -218,6 +222,13 @@ Entity *make_entity_library_name(gbAllocator a, Scope *scope, Token token, Type
return entity;
}
+Entity *make_entity_alias(gbAllocator a, Scope *scope, Token token, Type *type,
+ Entity *original) {
+ Entity *entity = alloc_entity(a, Entity_Alias, scope, token, type);
+ entity->Alias.original = original;
+ return entity;
+}
+
Entity *make_entity_nil(gbAllocator a, String name, Type *type) {
Token token = make_token_ident(name);
Entity *entity = alloc_entity(a, Entity_Nil, NULL, token, type);