aboutsummaryrefslogtreecommitdiff
path: root/src/entity.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2017-11-05 18:26:24 +0000
committergingerBill <bill@gingerbill.org>2017-11-05 18:26:24 +0000
commit66ee2cb6ed8ea511b2f8987678695f66d748cf1e (patch)
tree8f42579e9612198c908380ceefc40cc841f32eeb /src/entity.cpp
parent1d4881cbbe0da6c5f9cd4a99dd1bf65c5e00c51d (diff)
#const value procedure parameters; $N for polymorphic array lengths
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
index 8fb6f8b69..0cb05d428 100644
--- a/src/entity.cpp
+++ b/src/entity.cpp
@@ -43,6 +43,7 @@ enum EntityFlag {
EntityFlag_Value = 1<<9,
EntityFlag_Sret = 1<<10,
EntityFlag_BitFieldValue = 1<<11,
+ EntityFlag_PolyConst = 1<<12,
EntityFlag_CVarArg = 1<<20,
};
@@ -207,6 +208,16 @@ Entity *make_entity_param(gbAllocator a, Scope *scope, Token token, Type *type,
return entity;
}
+
+Entity *make_entity_const_param(gbAllocator a, Scope *scope, Token token, Type *type, ExactValue value, bool poly_const) {
+ Entity *entity = make_entity_constant(a, scope, token, type, value);
+ entity->flags |= EntityFlag_Used;
+ if (poly_const) entity->flags |= EntityFlag_PolyConst;
+ entity->flags |= EntityFlag_Param;
+ return entity;
+}
+
+
Entity *make_entity_field(gbAllocator a, Scope *scope, Token token, Type *type, bool is_using, i32 field_src_index) {
Entity *entity = make_entity_variable(a, scope, token, type, false);
entity->Variable.field_src_index = field_src_index;