diff options
Diffstat (limited to 'src/entity.cpp')
| -rw-r--r-- | src/entity.cpp | 11 |
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; |