aboutsummaryrefslogtreecommitdiff
path: root/src/tilde_stmt.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2023-10-30 15:00:55 +0000
committerGitHub <noreply@github.com>2023-10-30 15:00:55 +0000
commit51caa930caa903ecbf7926374cd129a7f64acf23 (patch)
treeac247a12015dc09d18d8c5c02ebe81f343176f6f /src/tilde_stmt.cpp
parent82cd30a14568814dfa70d383cf43c8d0d0bd6b16 (diff)
parentb7af4e7f6b3f8f96ca6d3efa492098293bfa4109 (diff)
Merge pull request #2905 from odin-lang/llvm-17-custom-passes
Explicit Optimization Passes for LLVM-17 Passes
Diffstat (limited to 'src/tilde_stmt.cpp')
-rw-r--r--src/tilde_stmt.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tilde_stmt.cpp b/src/tilde_stmt.cpp
index f45dda0bc..1a7dcce4d 100644
--- a/src/tilde_stmt.cpp
+++ b/src/tilde_stmt.cpp
@@ -1032,22 +1032,22 @@ gb_internal void cg_build_assignment(cgProcedure *p, Array<cgAddr> const &lvals,
continue;
}
- Type *type = cg_addr_type(lval);
+ Type *type = cg_addr_type(lval);
if (!cg_addr_is_empty(lval)) {
GB_ASSERT_MSG(are_types_identical(init.type, type), "%s = %s", type_to_string(init.type), type_to_string(type));
}
if (init.kind == cgValue_Addr &&
!cg_addr_is_empty(lval)) {
- // NOTE(bill): This is needed for certain constructs such as this:
- // a, b = b, a
- // NOTE(bill): This is a bodge and not necessarily a good way of doing things whatsoever
- TB_CharUnits size = cast(TB_CharUnits)type_size_of(type);
- TB_CharUnits align = cast(TB_CharUnits)type_align_of(type);
- TB_Node *copy = tb_inst_local(p->func, size, align);
- tb_inst_memcpy(p->func, copy, init.node, tb_inst_uint(p->func, TB_TYPE_INT, size), align);
- // use the copy instead
- init.node = copy;
+ // NOTE(bill): This is needed for certain constructs such as this:
+ // a, b = b, a
+ // NOTE(bill): This is a bodge and not necessarily a good way of doing things whatsoever
+ TB_CharUnits size = cast(TB_CharUnits)type_size_of(type);
+ TB_CharUnits align = cast(TB_CharUnits)type_align_of(type);
+ TB_Node *copy = tb_inst_local(p->func, size, align);
+ tb_inst_memcpy(p->func, copy, init.node, tb_inst_uint(p->func, TB_TYPE_INT, size), align);
+ // use the copy instead
+ init.node = copy;
}
inits[i] = init;
}