aboutsummaryrefslogtreecommitdiff
path: root/src/entity.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-12-01 19:11:00 +0000
committergingerBill <bill@gingerbill.org>2019-12-01 19:11:00 +0000
commite229885b2bd3b9b017f88d19a773bf989251ad51 (patch)
treeb9cfebff48333109f2089540c2a0ed828dd4881b /src/entity.cpp
parentee78374281493c47594bb16838de202d87c3b5e9 (diff)
Remove addressing mode `Addressing_Immutable`
Diffstat (limited to 'src/entity.cpp')
-rw-r--r--src/entity.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/entity.cpp b/src/entity.cpp
index c433d98cb..0c7bc8530 100644
--- a/src/entity.cpp
+++ b/src/entity.cpp
@@ -121,7 +121,6 @@ struct Entity {
String link_prefix;
bool is_foreign;
bool is_export;
- bool is_immutable;
} Variable;
struct {
Type * type_parameter_specialization;
@@ -216,9 +215,8 @@ Entity *alloc_entity(EntityKind kind, Scope *scope, Token token, Type *type) {
return entity;
}
-Entity *alloc_entity_variable(Scope *scope, Token token, Type *type, bool is_immutable, EntityState state = EntityState_Unresolved) {
+Entity *alloc_entity_variable(Scope *scope, Token token, Type *type, EntityState state = EntityState_Unresolved) {
Entity *entity = alloc_entity(Entity_Variable, scope, token, type);
- entity->Variable.is_immutable = is_immutable;
entity->state = state;
return entity;
}
@@ -250,8 +248,7 @@ Entity *alloc_entity_type_name(Scope *scope, Token token, Type *type, EntityStat
}
Entity *alloc_entity_param(Scope *scope, Token token, Type *type, bool is_using, bool is_value) {
- bool is_immutable = false;
- Entity *entity = alloc_entity_variable(scope, token, type, is_immutable);
+ Entity *entity = alloc_entity_variable(scope, token, type);
entity->flags |= EntityFlag_Used;
entity->flags |= EntityFlag_Param;
entity->state = EntityState_Resolved;
@@ -271,7 +268,7 @@ Entity *alloc_entity_const_param(Scope *scope, Token token, Type *type, ExactVal
Entity *alloc_entity_field(Scope *scope, Token token, Type *type, bool is_using, i32 field_src_index, EntityState state = EntityState_Unresolved) {
- Entity *entity = alloc_entity_variable(scope, token, type, false);
+ Entity *entity = alloc_entity_variable(scope, token, type);
entity->Variable.field_src_index = field_src_index;
entity->Variable.field_index = field_src_index;
if (is_using) entity->flags |= EntityFlag_Using;
@@ -281,7 +278,7 @@ Entity *alloc_entity_field(Scope *scope, Token token, Type *type, bool is_using,
}
Entity *alloc_entity_array_elem(Scope *scope, Token token, Type *type, i32 field_src_index) {
- Entity *entity = alloc_entity_variable(scope, token, type, false);
+ Entity *entity = alloc_entity_variable(scope, token, type);
entity->Variable.field_src_index = field_src_index;
entity->Variable.field_index = field_src_index;
entity->flags |= EntityFlag_Field;
@@ -347,6 +344,6 @@ Entity *alloc_entity_label(Scope *scope, Token token, Type *type, Ast *node, Ast
Entity *alloc_entity_dummy_variable(Scope *scope, Token token) {
token.string = str_lit("_");
- return alloc_entity_variable(scope, token, nullptr, false);
+ return alloc_entity_variable(scope, token, nullptr);
}