aboutsummaryrefslogtreecommitdiff
path: root/src/checker/entity.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-11-15 12:06:58 +0000
committerGinger Bill <bill@gingerbill.org>2016-11-15 12:06:58 +0000
commit0cab083b8fb31f33e96b68f3699ba5a83dbd3353 (patch)
tree14171c7e35dca94fee8c8b54f8120b08a76e8178 /src/checker/entity.cpp
parent3ce044f84f24b096156d6b4ce527c93a15f19147 (diff)
#foreign_library; vector fields (x, y, z, w) for count <= 4
Diffstat (limited to 'src/checker/entity.cpp')
-rw-r--r--src/checker/entity.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/checker/entity.cpp b/src/checker/entity.cpp
index 3a0bee3df..44c32bece 100644
--- a/src/checker/entity.cpp
+++ b/src/checker/entity.cpp
@@ -29,11 +29,12 @@ String const entity_strings[] = {
};
enum EntityFlag : u32 {
- EntityFlag_Visited = 1<<0,
- EntityFlag_Used = 1<<1,
- EntityFlag_Anonymous = 1<<2,
- EntityFlag_Field = 1<<3,
- EntityFlag_Param = 1<<4,
+ EntityFlag_Visited = 1<<0,
+ EntityFlag_Used = 1<<1,
+ EntityFlag_Anonymous = 1<<2,
+ EntityFlag_Field = 1<<3,
+ EntityFlag_Param = 1<<4,
+ EntityFlag_VectorElem = 1<<5,
};
struct Entity {
@@ -141,6 +142,15 @@ Entity *make_entity_field(gbAllocator a, Scope *scope, Token token, Type *type,
return entity;
}
+Entity *make_entity_vector_elem(gbAllocator a, Scope *scope, Token token, Type *type, i32 field_src_index) {
+ Entity *entity = make_entity_variable(a, scope, token, type);
+ entity->Variable.field_src_index = field_src_index;
+ entity->Variable.field_index = field_src_index;
+ entity->flags |= EntityFlag_Field;
+ entity->flags |= EntityFlag_VectorElem;
+ return entity;
+}
+
Entity *make_entity_procedure(gbAllocator a, Scope *scope, Token token, Type *signature_type) {
Entity *entity = alloc_entity(a, Entity_Procedure, scope, token, signature_type);
return entity;