diff options
| author | gingerBill <bill@gingerbill.org> | 2023-03-16 17:24:29 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-03-16 17:24:29 +0000 |
| commit | bfb231fb8adeea282a51e6903ac2e6c0d2656dda (patch) | |
| tree | 1898c4d1905416c66811d5743bedbd0efe55c51c /src/llvm_backend_const.cpp | |
| parent | 74fb74d9cb4de3e9e5950fe5b53ae8fc9215dbf5 (diff) | |
Simplify copy elision on variable declarations
Diffstat (limited to 'src/llvm_backend_const.cpp')
| -rw-r--r-- | src/llvm_backend_const.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp index 286c01f74..8db6e2a1f 100644 --- a/src/llvm_backend_const.cpp +++ b/src/llvm_backend_const.cpp @@ -485,13 +485,7 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, bo LLVMValueRef ptr = LLVMBuildInBoundsGEP2(p->builder, llvm_type, array_data, indices, 2, ""); LLVMValueRef len = LLVMConstInt(lb_type(m, t_int), count, true); - lbAddr slice = {}; - if (p->current_elision_hint.addr.value && are_types_identical(lb_addr_type(p->current_elision_hint), type)) { - slice = p->current_elision_hint; - p->current_elision_hint = {}; - } else { - slice = lb_add_local_generated(p, type, false); - } + lbAddr slice = lb_add_local_generated(p, type, false); map_set(&m->exact_value_compound_literal_addr_map, value.value_compound, slice); lb_fill_slice(p, slice, {ptr, alloc_type_pointer(elem)}, {len, t_int}); |