authorgravatar for dcocca@google.comDaniele Cocca <dcocca@google.com> 2021-06-16 20:27:46+01:00
committergravatar for dcocca@google.comDaniele Cocca <dcocca@google.com> 2021-06-16 21:56:39+01:00
log2242d3c3aa7d15c13737ae124f78a8261693100b
treea7ce3ba8cf45980e78fbf6d71ac9bb857a17b82c
parentbfe3558efe9faf20d68b947c9dc077963b1f87ad

{create,init}_const_slice: accept custom sentinel


4 files changed, 31 insertions(+), 31 deletions(-)

src/stage1/analyze.cpp+5-5
...@@ -6444,12 +6444,12 @@ ZigValue *create_const_type(CodeGen *g, ZigType *type_value) {...@@ -6444,12 +6444,12 @@ ZigValue *create_const_type(CodeGen *g, ZigType *type_value) {
6444}6444}
64456445
6446void init_const_slice(CodeGen *g, ZigValue *const_val, ZigValue *array_val,6446void init_const_slice(CodeGen *g, ZigValue *const_val, ZigValue *array_val,
6447 size_t start, size_t len, bool is_const)6447 size_t start, size_t len, bool is_const, ZigValue *sentinel)
6448{6448{
6449 assert(array_val->type->id == ZigTypeIdArray);6449 assert(array_val->type->id == ZigTypeIdArray);
64506450
6451 ZigType *ptr_type = get_pointer_to_type_extra(g, array_val->type->data.array.child_type,6451 ZigType *ptr_type = get_pointer_to_type_extra2(g, array_val->type->data.array.child_type,
6452 is_const, false, PtrLenUnknown, 0, 0, 0, false);6452 is_const, false, PtrLenUnknown, 0, 0, 0, false, VECTOR_INDEX_NONE, nullptr, sentinel);
64536453
6454 const_val->special = ConstValSpecialStatic;6454 const_val->special = ConstValSpecialStatic;
6455 const_val->type = get_slice_type(g, ptr_type);6455 const_val->type = get_slice_type(g, ptr_type);
...@@ -6460,9 +6460,9 @@ void init_const_slice(CodeGen *g, ZigValue *const_val, ZigValue *array_val,...@@ -6460,9 +6460,9 @@ void init_const_slice(CodeGen *g, ZigValue *const_val, ZigValue *array_val,
6460 init_const_usize(g, const_val->data.x_struct.fields[slice_len_index], len);6460 init_const_usize(g, const_val->data.x_struct.fields[slice_len_index], len);
6461}6461}
64626462
6463ZigValue *create_const_slice(CodeGen *g, ZigValue *array_val, size_t start, size_t len, bool is_const) {6463ZigValue *create_const_slice(CodeGen *g, ZigValue *array_val, size_t start, size_t len, bool is_const, ZigValue *sentinel) {
6464 ZigValue *const_val = g->pass1_arena->create<ZigValue>();6464 ZigValue *const_val = g->pass1_arena->create<ZigValue>();
6465 init_const_slice(g, const_val, array_val, start, len, is_const);6465 init_const_slice(g, const_val, array_val, start, len, is_const, sentinel);
6466 return const_val;6466 return const_val;
6467}6467}
64686468
src/stage1/analyze.hpp+2-2
...@@ -186,8 +186,8 @@ ZigValue *create_const_ptr_array(CodeGen *g, ZigValue *array_val, size_t elem_in...@@ -186,8 +186,8 @@ ZigValue *create_const_ptr_array(CodeGen *g, ZigValue *array_val, size_t elem_in
186 bool is_const, PtrLen ptr_len);186 bool is_const, PtrLen ptr_len);
187187
188void init_const_slice(CodeGen *g, ZigValue *const_val, ZigValue *array_val,188void init_const_slice(CodeGen *g, ZigValue *const_val, ZigValue *array_val,
189 size_t start, size_t len, bool is_const);189 size_t start, size_t len, bool is_const, ZigValue *sentinel);
190ZigValue *create_const_slice(CodeGen *g, ZigValue *array_val, size_t start, size_t len, bool is_const);190ZigValue *create_const_slice(CodeGen *g, ZigValue *array_val, size_t start, size_t len, bool is_const, ZigValue *sentinel);
191191
192void init_const_null(ZigValue *const_val, ZigType *type);192void init_const_null(ZigValue *const_val, ZigType *type);
193ZigValue *create_const_null(CodeGen *g, ZigType *type);193ZigValue *create_const_null(CodeGen *g, ZigType *type);
src/stage1/codegen.cpp+3-3
...@@ -1022,7 +1022,7 @@ static LLVMValueRef get_panic_msg_ptr_val(CodeGen *g, PanicMsgId msg_id) {...@@ -1022,7 +1022,7 @@ static LLVMValueRef get_panic_msg_ptr_val(CodeGen *g, PanicMsgId msg_id) {
10221022
1023 Buf *buf_msg = panic_msg_buf(msg_id);1023 Buf *buf_msg = panic_msg_buf(msg_id);
1024 ZigValue *array_val = create_const_str_lit(g, buf_msg)->data.x_ptr.data.ref.pointee;1024 ZigValue *array_val = create_const_str_lit(g, buf_msg)->data.x_ptr.data.ref.pointee;
1025 init_const_slice(g, val, array_val, 0, buf_len(buf_msg), true);1025 init_const_slice(g, val, array_val, 0, buf_len(buf_msg), true, nullptr);
10261026
1027 render_const_val(g, val, "");1027 render_const_val(g, val, "");
1028 render_const_val_global(g, val, "");1028 render_const_val_global(g, val, "");
...@@ -9424,7 +9424,7 @@ static void update_test_functions_builtin_decl(CodeGen *g) {...@@ -9424,7 +9424,7 @@ static void update_test_functions_builtin_decl(CodeGen *g) {
94249424
9425 ZigValue *name_field = this_val->data.x_struct.fields[0];9425 ZigValue *name_field = this_val->data.x_struct.fields[0];
9426 ZigValue *name_array_val = create_const_str_lit(g, &test_fn_entry->symbol_name)->data.x_ptr.data.ref.pointee;9426 ZigValue *name_array_val = create_const_str_lit(g, &test_fn_entry->symbol_name)->data.x_ptr.data.ref.pointee;
9427 init_const_slice(g, name_field, name_array_val, 0, buf_len(&test_fn_entry->symbol_name), true);9427 init_const_slice(g, name_field, name_array_val, 0, buf_len(&test_fn_entry->symbol_name), true, nullptr);
94289428
9429 ZigValue *fn_field = this_val->data.x_struct.fields[1];9429 ZigValue *fn_field = this_val->data.x_struct.fields[1];
9430 fn_field->type = fn_type;9430 fn_field->type = fn_type;
...@@ -9448,7 +9448,7 @@ static void update_test_functions_builtin_decl(CodeGen *g) {...@@ -9448,7 +9448,7 @@ static void update_test_functions_builtin_decl(CodeGen *g) {
9448 }9448 }
9449 report_errors_and_maybe_exit(g);9449 report_errors_and_maybe_exit(g);
94509450
9451 ZigValue *test_fn_slice = create_const_slice(g, test_fn_array, 0, g->test_fns.length, true);9451 ZigValue *test_fn_slice = create_const_slice(g, test_fn_array, 0, g->test_fns.length, true, nullptr);
94529452
9453 update_compile_var(g, buf_create_from_str("test_functions"), test_fn_slice);9453 update_compile_var(g, buf_create_from_str("test_functions"), test_fn_slice);
9454 assert(g->test_runner_package != nullptr);9454 assert(g->test_runner_package != nullptr);
src/stage1/ir.cpp+21-21
...@@ -5190,7 +5190,7 @@ static IrInstGen *ir_resolve_ptr_of_array_to_slice(IrAnalyze *ira, IrInst* sourc...@@ -5190,7 +5190,7 @@ static IrInstGen *ir_resolve_ptr_of_array_to_slice(IrAnalyze *ira, IrInst* sourc
5190 // undef_array->type = array_type;5190 // undef_array->type = array_type;
51915191
5192 // IrInstGen *result = ir_const(ira, source_instr, wanted_type);5192 // IrInstGen *result = ir_const(ira, source_instr, wanted_type);
5193 // init_const_slice(ira->codegen, result->value, undef_array, 0, 0, false);5193 // init_const_slice(ira->codegen, result->value, undef_array, 0, 0, false, nullptr);
5194 // result->value->data.x_struct.fields[slice_ptr_index]->data.x_ptr.mut = ConstPtrMutComptimeConst;5194 // result->value->data.x_struct.fields[slice_ptr_index]->data.x_ptr.mut = ConstPtrMutComptimeConst;
5195 // result->value->type = wanted_type;5195 // result->value->type = wanted_type;
5196 // return result;5196 // return result;
...@@ -5217,7 +5217,7 @@ static IrInstGen *ir_resolve_ptr_of_array_to_slice(IrAnalyze *ira, IrInst* sourc...@@ -5217,7 +5217,7 @@ static IrInstGen *ir_resolve_ptr_of_array_to_slice(IrAnalyze *ira, IrInst* sourc
5217 undef_array->type = array_type;5217 undef_array->type = array_type;
52185218
5219 IrInstGen *result = ir_const(ira, source_instr, wanted_type);5219 IrInstGen *result = ir_const(ira, source_instr, wanted_type);
5220 init_const_slice(ira->codegen, result->value, undef_array, 0, 0, false);5220 init_const_slice(ira->codegen, result->value, undef_array, 0, 0, false, nullptr);
5221 result->value->data.x_struct.fields[slice_ptr_index]->data.x_ptr.mut = ConstPtrMutComptimeConst;5221 result->value->data.x_struct.fields[slice_ptr_index]->data.x_ptr.mut = ConstPtrMutComptimeConst;
5222 result->value->type = wanted_type;5222 result->value->type = wanted_type;
5223 return result;5223 return result;
...@@ -5230,7 +5230,7 @@ static IrInstGen *ir_resolve_ptr_of_array_to_slice(IrAnalyze *ira, IrInst* sourc...@@ -5230,7 +5230,7 @@ static IrInstGen *ir_resolve_ptr_of_array_to_slice(IrAnalyze *ira, IrInst* sourc
5230 IrInstGen *result = ir_const(ira, source_instr, wanted_type);5230 IrInstGen *result = ir_const(ira, source_instr, wanted_type);
5231 init_const_slice(ira->codegen, result->value, array_val,5231 init_const_slice(ira->codegen, result->value, array_val,
5232 array_ptr_val->data.x_ptr.data.base_array.elem_index,5232 array_ptr_val->data.x_ptr.data.base_array.elem_index,
5233 array_type->data.array.len, wanted_const);5233 array_type->data.array.len, wanted_const, nullptr);
5234 result->value->data.x_struct.fields[slice_ptr_index]->data.x_ptr.mut = array_ptr_val->data.x_ptr.mut;5234 result->value->data.x_struct.fields[slice_ptr_index]->data.x_ptr.mut = array_ptr_val->data.x_ptr.mut;
5235 result->value->type = wanted_type;5235 result->value->type = wanted_type;
5236 return result;5236 return result;
...@@ -5243,7 +5243,7 @@ static IrInstGen *ir_resolve_ptr_of_array_to_slice(IrAnalyze *ira, IrInst* sourc...@@ -5243,7 +5243,7 @@ static IrInstGen *ir_resolve_ptr_of_array_to_slice(IrAnalyze *ira, IrInst* sourc
5243 assert(array_ptr_val->type->id == ZigTypeIdPointer);5243 assert(array_ptr_val->type->id == ZigTypeIdPointer);
52445244
5245 IrInstGen *result = ir_const(ira, source_instr, wanted_type);5245 IrInstGen *result = ir_const(ira, source_instr, wanted_type);
5246 init_const_slice(ira->codegen, result->value, pointee, 0, array_type->data.array.len, wanted_const);5246 init_const_slice(ira->codegen, result->value, pointee, 0, array_type->data.array.len, wanted_const, nullptr);
5247 result->value->data.x_struct.fields[slice_ptr_index]->data.x_ptr.mut = array_ptr_val->data.x_ptr.mut;5247 result->value->data.x_struct.fields[slice_ptr_index]->data.x_ptr.mut = array_ptr_val->data.x_ptr.mut;
5248 result->value->type = wanted_type;5248 result->value->type = wanted_type;
5249 return result;5249 return result;
...@@ -14449,7 +14449,7 @@ static IrInstGen *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstSrcElemP...@@ -14449,7 +14449,7 @@ static IrInstGen *ir_analyze_instruction_elem_ptr(IrAnalyze *ira, IrInstSrcElemP
14449 }14449 }
1445014450
14451 init_const_slice(ira->codegen, array_ptr_val, array_init_val, 0, actual_array_type->data.array.len,14451 init_const_slice(ira->codegen, array_ptr_val, array_init_val, 0, actual_array_type->data.array.len,
14452 false);14452 false, nullptr);
14453 array_ptr_val->data.x_struct.fields[slice_ptr_index]->data.x_ptr.mut = ConstPtrMutInfer;14453 array_ptr_val->data.x_struct.fields[slice_ptr_index]->data.x_ptr.mut = ConstPtrMutInfer;
14454 } else {14454 } else {
14455 ir_add_error_node(ira, elem_ptr_instruction->init_array_type_source_node,14455 ir_add_error_node(ira, elem_ptr_instruction->init_array_type_source_node,
...@@ -17249,7 +17249,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa...@@ -17249,7 +17249,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa
17249 declaration_array->type = get_array_type(ira->codegen, type_info_declaration_type, declaration_count, nullptr);17249 declaration_array->type = get_array_type(ira->codegen, type_info_declaration_type, declaration_count, nullptr);
17250 declaration_array->data.x_array.special = ConstArraySpecialNone;17250 declaration_array->data.x_array.special = ConstArraySpecialNone;
17251 declaration_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(declaration_count);17251 declaration_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(declaration_count);
17252 init_const_slice(ira->codegen, out_val, declaration_array, 0, declaration_count, false);17252 init_const_slice(ira->codegen, out_val, declaration_array, 0, declaration_count, false, nullptr);
1725317253
17254 // Loop through the declarations and generate info.17254 // Loop through the declarations and generate info.
17255 decl_it = decls_scope->decl_table.entry_iterator();17255 decl_it = decls_scope->decl_table.entry_iterator();
...@@ -17272,7 +17272,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa...@@ -17272,7 +17272,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa
1727217272
17273 ZigValue **inner_fields = alloc_const_vals_ptrs(ira->codegen, 3);17273 ZigValue **inner_fields = alloc_const_vals_ptrs(ira->codegen, 3);
17274 ZigValue *name = create_const_str_lit(ira->codegen, curr_entry->key)->data.x_ptr.data.ref.pointee;17274 ZigValue *name = create_const_str_lit(ira->codegen, curr_entry->key)->data.x_ptr.data.ref.pointee;
17275 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(curr_entry->key), true);17275 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(curr_entry->key), true, nullptr);
17276 inner_fields[1]->special = ConstValSpecialStatic;17276 inner_fields[1]->special = ConstValSpecialStatic;
17277 inner_fields[1]->type = ira->codegen->builtin_types.entry_bool;17277 inner_fields[1]->type = ira->codegen->builtin_types.entry_bool;
17278 inner_fields[1]->data.x_bool = curr_entry->value->visib_mod == VisibModPub;17278 inner_fields[1]->data.x_bool = curr_entry->value->visib_mod == VisibModPub;
...@@ -17368,7 +17368,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa...@@ -17368,7 +17368,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa
17368 if (fn_node->is_extern && fn_node->lib_name != nullptr && buf_len(fn_node->lib_name) > 0) {17368 if (fn_node->is_extern && fn_node->lib_name != nullptr && buf_len(fn_node->lib_name) > 0) {
17369 ZigValue *slice_val = ira->codegen->pass1_arena->create<ZigValue>();17369 ZigValue *slice_val = ira->codegen->pass1_arena->create<ZigValue>();
17370 ZigValue *lib_name = create_const_str_lit(ira->codegen, fn_node->lib_name)->data.x_ptr.data.ref.pointee;17370 ZigValue *lib_name = create_const_str_lit(ira->codegen, fn_node->lib_name)->data.x_ptr.data.ref.pointee;
17371 init_const_slice(ira->codegen, slice_val, lib_name, 0, buf_len(fn_node->lib_name), true);17371 init_const_slice(ira->codegen, slice_val, lib_name, 0, buf_len(fn_node->lib_name), true, nullptr);
17372 set_optional_payload(fn_decl_fields[5], slice_val);17372 set_optional_payload(fn_decl_fields[5], slice_val);
17373 } else {17373 } else {
17374 set_optional_payload(fn_decl_fields[5], nullptr);17374 set_optional_payload(fn_decl_fields[5], nullptr);
...@@ -17388,14 +17388,14 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa...@@ -17388,14 +17388,14 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa
17388 fn_arg_name_array->data.x_array.special = ConstArraySpecialNone;17388 fn_arg_name_array->data.x_array.special = ConstArraySpecialNone;
17389 fn_arg_name_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(fn_arg_count);17389 fn_arg_name_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(fn_arg_count);
1739017390
17391 init_const_slice(ira->codegen, fn_decl_fields[7], fn_arg_name_array, 0, fn_arg_count, false);17391 init_const_slice(ira->codegen, fn_decl_fields[7], fn_arg_name_array, 0, fn_arg_count, false, nullptr);
1739217392
17393 for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) {17393 for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) {
17394 ZigVar *arg_var = fn_entry->variable_list.at(fn_arg_index);17394 ZigVar *arg_var = fn_entry->variable_list.at(fn_arg_index);
17395 ZigValue *fn_arg_name_val = &fn_arg_name_array->data.x_array.data.s_none.elements[fn_arg_index];17395 ZigValue *fn_arg_name_val = &fn_arg_name_array->data.x_array.data.s_none.elements[fn_arg_index];
17396 ZigValue *arg_name = create_const_str_lit(ira->codegen,17396 ZigValue *arg_name = create_const_str_lit(ira->codegen,
17397 buf_create_from_str(arg_var->name))->data.x_ptr.data.ref.pointee;17397 buf_create_from_str(arg_var->name))->data.x_ptr.data.ref.pointee;
17398 init_const_slice(ira->codegen, fn_arg_name_val, arg_name, 0, strlen(arg_var->name), true);17398 init_const_slice(ira->codegen, fn_arg_name_val, arg_name, 0, strlen(arg_var->name), true, nullptr);
17399 fn_arg_name_val->parent.id = ConstParentIdArray;17399 fn_arg_name_val->parent.id = ConstParentIdArray;
17400 fn_arg_name_val->parent.data.p_array.array_val = fn_arg_name_array;17400 fn_arg_name_val->parent.data.p_array.array_val = fn_arg_name_array;
17401 fn_arg_name_val->parent.data.p_array.elem_index = fn_arg_index;17401 fn_arg_name_val->parent.data.p_array.elem_index = fn_arg_index;
...@@ -17531,7 +17531,7 @@ static void make_enum_field_val(IrAnalyze *ira, ZigValue *enum_field_val, TypeEn...@@ -17531,7 +17531,7 @@ static void make_enum_field_val(IrAnalyze *ira, ZigValue *enum_field_val, TypeEn
17531 inner_fields[1]->type = ira->codegen->builtin_types.entry_num_lit_int;17531 inner_fields[1]->type = ira->codegen->builtin_types.entry_num_lit_int;
1753217532
17533 ZigValue *name = create_const_str_lit(ira->codegen, enum_field->name)->data.x_ptr.data.ref.pointee;17533 ZigValue *name = create_const_str_lit(ira->codegen, enum_field->name)->data.x_ptr.data.ref.pointee;
17534 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(enum_field->name), true);17534 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(enum_field->name), true, nullptr);
1753517535
17536 bigint_init_bigint(&inner_fields[1]->data.x_bigint, &enum_field->value);17536 bigint_init_bigint(&inner_fields[1]->data.x_bigint, &enum_field->value);
1753717537
...@@ -17732,7 +17732,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy...@@ -17732,7 +17732,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
17732 enum_field_array->data.x_array.special = ConstArraySpecialNone;17732 enum_field_array->data.x_array.special = ConstArraySpecialNone;
17733 enum_field_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(enum_field_count);17733 enum_field_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(enum_field_count);
1773417734
17735 init_const_slice(ira->codegen, fields[2], enum_field_array, 0, enum_field_count, false);17735 init_const_slice(ira->codegen, fields[2], enum_field_array, 0, enum_field_count, false, nullptr);
1773617736
17737 for (uint32_t enum_field_index = 0; enum_field_index < enum_field_count; enum_field_index++)17737 for (uint32_t enum_field_index = 0; enum_field_index < enum_field_count; enum_field_index++)
17738 {17738 {
...@@ -17785,7 +17785,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy...@@ -17785,7 +17785,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
17785 error_array->data.x_array.special = ConstArraySpecialNone;17785 error_array->data.x_array.special = ConstArraySpecialNone;
17786 error_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(error_count);17786 error_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(error_count);
1778717787
17788 init_const_slice(ira->codegen, slice_val, error_array, 0, error_count, false);17788 init_const_slice(ira->codegen, slice_val, error_array, 0, error_count, false, nullptr);
17789 for (uint32_t error_index = 0; error_index < error_count; error_index++) {17789 for (uint32_t error_index = 0; error_index < error_count; error_index++) {
17790 ErrorTableEntry *error = type_entry->data.error_set.errors[error_index];17790 ErrorTableEntry *error = type_entry->data.error_set.errors[error_index];
17791 ZigValue *error_val = &error_array->data.x_array.data.s_none.elements[error_index];17791 ZigValue *error_val = &error_array->data.x_array.data.s_none.elements[error_index];
...@@ -17800,7 +17800,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy...@@ -17800,7 +17800,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
17800 name = error->cached_error_name_val;17800 name = error->cached_error_name_val;
17801 if (name == nullptr)17801 if (name == nullptr)
17802 name = create_const_str_lit(ira->codegen, &error->name)->data.x_ptr.data.ref.pointee;17802 name = create_const_str_lit(ira->codegen, &error->name)->data.x_ptr.data.ref.pointee;
17803 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(&error->name), true);17803 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(&error->name), true, nullptr);
1780417804
17805 error_val->data.x_struct.fields = inner_fields;17805 error_val->data.x_struct.fields = inner_fields;
17806 error_val->parent.id = ConstParentIdArray;17806 error_val->parent.id = ConstParentIdArray;
...@@ -17881,7 +17881,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy...@@ -17881,7 +17881,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
17881 union_field_array->data.x_array.special = ConstArraySpecialNone;17881 union_field_array->data.x_array.special = ConstArraySpecialNone;
17882 union_field_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(union_field_count);17882 union_field_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(union_field_count);
1788317883
17884 init_const_slice(ira->codegen, fields[2], union_field_array, 0, union_field_count, false);17884 init_const_slice(ira->codegen, fields[2], union_field_array, 0, union_field_count, false, nullptr);
1788517885
17886 for (uint32_t union_field_index = 0; union_field_index < union_field_count; union_field_index++) {17886 for (uint32_t union_field_index = 0; union_field_index < union_field_count; union_field_index++) {
17887 TypeUnionField *union_field = &type_entry->data.unionation.fields[union_field_index];17887 TypeUnionField *union_field = &type_entry->data.unionation.fields[union_field_index];
...@@ -17902,7 +17902,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy...@@ -17902,7 +17902,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
17902 bigint_init_unsigned(&inner_fields[2]->data.x_bigint, union_field->align);17902 bigint_init_unsigned(&inner_fields[2]->data.x_bigint, union_field->align);
1790317903
17904 ZigValue *name = create_const_str_lit(ira->codegen, union_field->name)->data.x_ptr.data.ref.pointee;17904 ZigValue *name = create_const_str_lit(ira->codegen, union_field->name)->data.x_ptr.data.ref.pointee;
17905 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(union_field->name), true);17905 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(union_field->name), true, nullptr);
1790617906
17907 union_field_val->data.x_struct.fields = inner_fields;17907 union_field_val->data.x_struct.fields = inner_fields;
17908 union_field_val->parent.id = ConstParentIdArray;17908 union_field_val->parent.id = ConstParentIdArray;
...@@ -17958,7 +17958,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy...@@ -17958,7 +17958,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
17958 struct_field_array->data.x_array.special = ConstArraySpecialNone;17958 struct_field_array->data.x_array.special = ConstArraySpecialNone;
17959 struct_field_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(struct_field_count);17959 struct_field_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(struct_field_count);
1796017960
17961 init_const_slice(ira->codegen, fields[1], struct_field_array, 0, struct_field_count, false);17961 init_const_slice(ira->codegen, fields[1], struct_field_array, 0, struct_field_count, false, nullptr);
1796217962
17963 for (uint32_t struct_field_index = 0; struct_field_index < struct_field_count; struct_field_index++) {17963 for (uint32_t struct_field_index = 0; struct_field_index < struct_field_count; struct_field_index++) {
17964 TypeStructField *struct_field = type_entry->data.structure.fields[struct_field_index];17964 TypeStructField *struct_field = type_entry->data.structure.fields[struct_field_index];
...@@ -17994,7 +17994,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy...@@ -17994,7 +17994,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
17994 bigint_init_unsigned(&inner_fields[4]->data.x_bigint, struct_field->align);17994 bigint_init_unsigned(&inner_fields[4]->data.x_bigint, struct_field->align);
1799517995
17996 ZigValue *name = create_const_str_lit(ira->codegen, struct_field->name)->data.x_ptr.data.ref.pointee;17996 ZigValue *name = create_const_str_lit(ira->codegen, struct_field->name)->data.x_ptr.data.ref.pointee;
17997 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(struct_field->name), true);17997 init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(struct_field->name), true, nullptr);
1799817998
17999 struct_field_val->data.x_struct.fields = inner_fields;17999 struct_field_val->data.x_struct.fields = inner_fields;
18000 struct_field_val->parent.id = ConstParentIdArray;18000 struct_field_val->parent.id = ConstParentIdArray;
...@@ -18074,7 +18074,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy...@@ -18074,7 +18074,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy
18074 fn_arg_array->data.x_array.special = ConstArraySpecialNone;18074 fn_arg_array->data.x_array.special = ConstArraySpecialNone;
18075 fn_arg_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(fn_arg_count);18075 fn_arg_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(fn_arg_count);
1807618076
18077 init_const_slice(ira->codegen, fields[5], fn_arg_array, 0, fn_arg_count, false);18077 init_const_slice(ira->codegen, fields[5], fn_arg_array, 0, fn_arg_count, false, nullptr);
1807818078
18079 for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) {18079 for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) {
18080 FnTypeParamInfo *fn_param_info = &type_entry->data.fn.fn_type_id.param_info[fn_arg_index];18080 FnTypeParamInfo *fn_param_info = &type_entry->data.fn.fn_type_id.param_info[fn_arg_index];
...@@ -24150,7 +24150,7 @@ static IrInstGen *ir_analyze_instruction_src(IrAnalyze *ira, IrInstSrcSrc *instr...@@ -24150,7 +24150,7 @@ static IrInstGen *ir_analyze_instruction_src(IrAnalyze *ira, IrInstSrcSrc *instr
24150 RootStruct *root_struct = import->data.structure.root_struct;24150 RootStruct *root_struct = import->data.structure.root_struct;
24151 Buf *path = root_struct->path;24151 Buf *path = root_struct->path;
24152 ZigValue *file_name = create_const_str_lit(ira->codegen, path)->data.x_ptr.data.ref.pointee;24152 ZigValue *file_name = create_const_str_lit(ira->codegen, path)->data.x_ptr.data.ref.pointee;
24153 init_const_slice(ira->codegen, fields[0], file_name, 0, buf_len(path), true);24153 init_const_slice(ira->codegen, fields[0], file_name, 0, buf_len(path), true, nullptr);
24154 fields[0]->type = u8_slice;24154 fields[0]->type = u8_slice;
2415524155
24156 // fn_name: [:0]const u824156 // fn_name: [:0]const u8
...@@ -24158,7 +24158,7 @@ static IrInstGen *ir_analyze_instruction_src(IrAnalyze *ira, IrInstSrcSrc *instr...@@ -24158,7 +24158,7 @@ static IrInstGen *ir_analyze_instruction_src(IrAnalyze *ira, IrInstSrcSrc *instr
24158 fields[1]->special = ConstValSpecialStatic;24158 fields[1]->special = ConstValSpecialStatic;
2415924159
24160 ZigValue *fn_name = create_const_str_lit(ira->codegen, &fn_entry->symbol_name)->data.x_ptr.data.ref.pointee;24160 ZigValue *fn_name = create_const_str_lit(ira->codegen, &fn_entry->symbol_name)->data.x_ptr.data.ref.pointee;
24161 init_const_slice(ira->codegen, fields[1], fn_name, 0, buf_len(&fn_entry->symbol_name), true);24161 init_const_slice(ira->codegen, fields[1], fn_name, 0, buf_len(&fn_entry->symbol_name), true, nullptr);
24162 fields[1]->type = u8_slice;24162 fields[1]->type = u8_slice;
2416324163
2416424164