From 66ee2cb6ed8ea511b2f8987678695f66d748cf1e Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 5 Nov 2017 18:26:24 +0000 Subject: #const value procedure parameters; $N for polymorphic array lengths --- src/entity.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/entity.cpp') 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; -- cgit v1.2.3