mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-04 04:02:33 +00:00
Simplify copy elision on variable declarations
This commit is contained in:
@@ -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});
|
||||
|
||||
Reference in New Issue
Block a user