diff options
| author | gingerBill <bill@gingerbill.org> | 2023-01-03 17:26:05 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-01-03 17:26:05 +0000 |
| commit | 855ebceadcc4612a6451f268ab6d6693838ed5f4 (patch) | |
| tree | eb26d4b572706c8b242ec437e3b552827f7e312f /src | |
| parent | 2720e9812778c8cf28ead9c41c46b0d578f6a7b3 (diff) | |
Minimize `add_type_info_type` usage
Diffstat (limited to 'src')
| -rw-r--r-- | src/check_builtin.cpp | 2 | ||||
| -rw-r--r-- | src/check_expr.cpp | 8 | ||||
| -rw-r--r-- | src/check_stmt.cpp | 8 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index 7c5521dde..606283c32 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -3573,7 +3573,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As Entity *base_type_entity = alloc_entity_type_name(scope, token, elem, EntityState_Resolved); add_entity(c, scope, nullptr, base_type_entity); - add_type_info_type(c, soa_struct); + // add_type_info_type(c, soa_struct); operand->type = soa_struct; break; diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 746a29ce0..5f28504a2 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -8779,8 +8779,8 @@ gb_internal ExprKind check_type_assertion(CheckerContext *c, Operand *o, Ast *no return kind; } - add_type_info_type(c, o->type); - add_type_info_type(c, bsrc->Union.variants[0]); + // add_type_info_type(c, o->type); + // add_type_info_type(c, bsrc->Union.variants[0]); o->type = bsrc->Union.variants[0]; o->mode = Addressing_OptionalOk; @@ -8812,8 +8812,8 @@ gb_internal ExprKind check_type_assertion(CheckerContext *c, Operand *o, Ast *no return kind; } - add_type_info_type(c, o->type); - add_type_info_type(c, t); + // add_type_info_type(c, o->type); + // add_type_info_type(c, t); o->type = t; o->mode = Addressing_OptionalOk; diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 6e84d0789..9547035d0 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1132,7 +1132,7 @@ gb_internal void check_type_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_ check_expr(ctx, &x, rhs); check_assignment(ctx, &x, nullptr, str_lit("type switch expression")); - add_type_info_type(ctx, x.type); + // add_type_info_type(ctx, x.type); TypeSwitchKind switch_kind = check_valid_type_switch_type(x.type); if (switch_kind == TypeSwitch_Invalid) { @@ -1223,7 +1223,7 @@ gb_internal void check_type_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_ continue; } case_type = y.type; - add_type_info_type(ctx, y.type); + // add_type_info_type(ctx, y.type); } else if (switch_kind == TypeSwitch_Any) { case_type = y.type; add_type_info_type(ctx, y.type); @@ -1259,7 +1259,9 @@ gb_internal void check_type_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_ if (case_type == nullptr) { case_type = x.type; } - add_type_info_type(ctx, case_type); + if (switch_kind == TypeSwitch_Any) { + add_type_info_type(ctx, case_type); + } check_open_scope(ctx, stmt); { |