aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-05-15 18:59:54 +0100
committergingerBill <bill@gingerbill.org>2021-05-15 18:59:54 +0100
commit7b7081d60733caa996a89be2651482a2aeed8bbd (patch)
tree6162be3716d2e72aa922370fe0c9587e6e7e40df /src/check_stmt.cpp
parent5ae564cc8c6934675c25cb251e753103e4549c52 (diff)
Remove old dead code
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index 9ca53c4fc..a954b44b6 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -1489,53 +1489,6 @@ void check_stmt_internal(CheckerContext *ctx, Ast *node, u32 flags) {
auto lhs_to_ignore = array_make<bool>(temporary_allocator(), lhs_count);
isize max = gb_min(lhs_count, rhs_count);
- // NOTE(bill, 2020-05-02): This is an utter hack to get these custom atom operations working
- // correctly for assignments
- for (isize i = 0; i < max; i++) {
- if (lhs_operands[i].mode == Addressing_AtomOpAssign) {
- Operand lhs = lhs_operands[i];
-
- Type *t = base_type(lhs.type);
- GB_ASSERT(t->kind == Type_Struct);
- ast_node(ie, IndexExpr, unparen_expr(lhs.expr));
-
- TypeAtomOpTable *atom_op_table = t->Struct.atom_op_table;
- GB_ASSERT(atom_op_table->op[TypeAtomOp_index_set] != nullptr);
- Entity *e = atom_op_table->op[TypeAtomOp_index_set];
-
- GB_ASSERT(e->identifier != nullptr);
- Ast *proc_ident = clone_ast(e->identifier);
- GB_ASSERT(ctx->file != nullptr);
-
-
- TypeAndValue tv = type_and_value_of_expr(ie->expr);
- Ast *expr = ie->expr;
- if (is_type_pointer(tv.type)) {
- // Okay
- } else if (tv.mode == Addressing_Variable) {
- // NOTE(bill): Hack it to take the address instead
- expr = ast_unary_expr(ctx->file, {Token_And, STR_LIT("&")}, ie->expr);
- } else {
- continue;
- }
-
- auto args = array_make<Ast *>(heap_allocator(), 3);
- args[0] = expr;
- args[1] = ie->index;
- args[2] = rhs_operands[i].expr;
-
- Ast *fake_call = ast_call_expr(ctx->file, proc_ident, args, ie->open, ie->close, {});
- Operand fake_operand = {};
- fake_operand.expr = lhs.expr;
- check_expr_base(ctx, &fake_operand, fake_call, nullptr);
- AtomOpMapEntry entry = {TypeAtomOp_index_set, fake_call};
- map_set(&ctx->info->atom_op_map, hash_pointer(lhs.expr), entry);
-
- lhs_to_ignore[i] = true;
-
- }
- }
-
for (isize i = 0; i < max; i++) {
if (lhs_to_ignore[i]) {
continue;