aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2017-12-17 14:53:40 +0000
committergingerBill <bill@gingerbill.org>2017-12-17 14:53:40 +0000
commit30530d058ca22eea3dcb0401a6bd6d288deb3ce0 (patch)
tree47193c49795d4b42cf096938df6fc08f75bd0ea8 /src/check_type.cpp
parent436928d06a8bf38b5ee4b188169e02a609d8d955 (diff)
Remove `struct #ordered`
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 0bee3171f..6fee664d5 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -216,8 +216,6 @@ Array<Entity *> check_struct_fields(Checker *c, AstNode *node, Array<AstNode *>
// TODO(bill): Cleanup struct field reordering
// TODO(bill): Inline sorting procedure?
-gb_global gbAllocator __checker_allocator = {};
-
GB_COMPARE_PROC(cmp_reorder_struct_fields) {
// Rule:
// 'using' over non-'using'
@@ -232,10 +230,10 @@ GB_COMPARE_PROC(cmp_reorder_struct_fields) {
GB_ASSERT(y->kind == Entity_Variable);
bool xu = (x->flags & EntityFlag_Using) != 0;
bool yu = (y->flags & EntityFlag_Using) != 0;
- i64 xa = type_align_of(__checker_allocator, x->type);
- i64 ya = type_align_of(__checker_allocator, y->type);
- i64 xs = type_size_of(__checker_allocator, x->type);
- i64 ys = type_size_of(__checker_allocator, y->type);
+ i64 xa = type_align_of(heap_allocator(), x->type);
+ i64 ya = type_align_of(heap_allocator(), y->type);
+ i64 xs = type_size_of(heap_allocator(), x->type);
+ i64 ys = type_size_of(heap_allocator(), y->type);
if (xu != yu) {
return xu ? -1 : +1;
@@ -545,7 +543,6 @@ void check_struct_type(Checker *c, Type *struct_type, AstNode *node, Array<Opera
struct_type->Struct.scope = c->context.scope;
struct_type->Struct.is_packed = st->is_packed;
- struct_type->Struct.is_ordered = st->is_ordered;
struct_type->Struct.polymorphic_params = polymorphic_params;
struct_type->Struct.is_polymorphic = is_polymorphic;
struct_type->Struct.is_poly_specialized = is_poly_specialized;
@@ -590,7 +587,6 @@ void check_struct_type(Checker *c, Type *struct_type, AstNode *node, Array<Opera
// NOTE(bill): Hacky thing
// TODO(bill): Probably make an inline sorting procedure rather than use global variables
- __checker_allocator = c->allocator;
// NOTE(bill): compound literal order must match source not layout
gb_sort_array(reordered_fields.data, fields.count, cmp_reorder_struct_fields);
@@ -1806,7 +1802,6 @@ void generate_map_entry_type(gbAllocator a, Type *type) {
array_add(&fields, make_entity_field(a, s, make_token_ident(str_lit("value")), type->Map.value, false, 2));
- entry_type->Struct.is_ordered = true;
entry_type->Struct.fields = fields;
entry_type->Struct.fields_in_src_order = fields;
@@ -1844,7 +1839,6 @@ void generate_map_internal_types(gbAllocator a, Type *type) {
array_add(&fields, make_entity_field(a, s, make_token_ident(str_lit("hashes")), hashes_type, false, 0));
array_add(&fields, make_entity_field(a, s, make_token_ident(str_lit("entries")), entries_type, false, 1));
- generated_struct_type->Struct.is_ordered = true;
generated_struct_type->Struct.fields = fields;
generated_struct_type->Struct.fields_in_src_order = fields;