From f5bc95eb349c75c8378a0a35104fd763db7742a1 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 13 Sep 2021 01:07:24 +0100 Subject: More culling --- src/check_type.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/check_type.cpp') diff --git a/src/check_type.cpp b/src/check_type.cpp index 2c9f589c7..32a40de12 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -188,13 +188,6 @@ void check_struct_fields(CheckerContext *ctx, Ast *node, Slice *fields } -Entity *make_names_field_for_struct(CheckerContext *ctx, Scope *scope) { - Entity *e = alloc_entity_field(scope, make_token_ident(str_lit("names")), t_string_slice, false, 0); - e->flags |= EntityFlag_TypeField; - e->flags |= EntityFlag_Value; - return e; -} - bool check_custom_align(CheckerContext *ctx, Ast *node, i64 *align_) { GB_ASSERT(align_ != nullptr); Operand o = {}; @@ -565,8 +558,7 @@ void check_struct_type(CheckerContext *ctx, Type *struct_type, Ast *node, Array< case_end; } } - struct_type->Struct.names = make_names_field_for_struct(ctx, ctx->scope); - + scope_reserve(ctx->scope, min_field_count); if (st->is_raw_union && min_field_count > 1) { @@ -658,7 +650,7 @@ void check_union_type(CheckerContext *ctx, Type *union_type, Ast *node, ArrayUnion.variants = variants; + union_type->Union.variants = slice_from_array(variants); union_type->Union.no_nil = ut->no_nil; union_type->Union.maybe = ut->maybe; if (union_type->Union.no_nil) { @@ -818,7 +810,6 @@ void check_enum_type(CheckerContext *ctx, Type *enum_type, Type *named_type, Ast enum_type->Enum.fields = fields; - enum_type->Enum.names = make_names_field_for_struct(ctx, ctx->scope); *enum_type->Enum.min_value = min_value; *enum_type->Enum.max_value = max_value; -- cgit v1.2.3