| ... | @@ -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; |
| 5191 | | 5191 | |
| 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; |
| 5218 | | 5218 | |
| 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); |
| 5244 | | 5244 | |
| 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 | } |
| 14450 | | 14450 | |
| 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, |
| ... | @@ -16864,26 +16864,27 @@ static IrInstGen *ir_analyze_instruction_err_name(IrAnalyze *ira, IrInstSrcErrNa | ... | @@ -16864,26 +16864,27 @@ static IrInstGen *ir_analyze_instruction_err_name(IrAnalyze *ira, IrInstSrcErrNa |
| 16864 | if (type_is_invalid(casted_value->value->type)) | 16864 | if (type_is_invalid(casted_value->value->type)) |
| 16865 | return ira->codegen->invalid_inst_gen; | 16865 | return ira->codegen->invalid_inst_gen; |
| 16866 | | 16866 | |
| 16867 | ZigType *u8_ptr_type = get_pointer_to_type_extra(ira->codegen, ira->codegen->builtin_types.entry_u8, | | |
| 16868 | true, false, PtrLenUnknown, 0, 0, 0, false); | | |
| 16869 | ZigType *str_type = get_slice_type(ira->codegen, u8_ptr_type); | | |
| 16870 | if (instr_is_comptime(casted_value)) { | 16867 | if (instr_is_comptime(casted_value)) { |
| 16871 | ZigValue *val = ir_resolve_const(ira, casted_value, UndefBad); | 16868 | ZigValue *val = ir_resolve_const(ira, casted_value, UndefBad); |
| 16872 | if (val == nullptr) | 16869 | if (val == nullptr) |
| 16873 | return ira->codegen->invalid_inst_gen; | 16870 | return ira->codegen->invalid_inst_gen; |
| 16874 | ErrorTableEntry *err = casted_value->value->data.x_err_set; | 16871 | ErrorTableEntry *err = casted_value->value->data.x_err_set; |
| 16875 | if (!err->cached_error_name_val) { | 16872 | if (!err->cached_error_name_val) { |
| 16876 | ZigValue *array_val = create_const_str_lit(ira->codegen, &err->name)->data.x_ptr.data.ref.pointee; | 16873 | err->cached_error_name_val = create_sentineled_str_lit( |
| 16877 | err->cached_error_name_val = create_const_slice(ira->codegen, array_val, 0, buf_len(&err->name), true); | 16874 | ira->codegen, &err->name, |
| | 16875 | ira->codegen->intern.for_zero_byte()); |
| 16878 | } | 16876 | } |
| 16879 | IrInstGen *result = ir_const(ira, &instruction->base.base, nullptr); | 16877 | IrInstGen *result = ir_const(ira, &instruction->base.base, nullptr); |
| 16880 | copy_const_val(ira->codegen, result->value, err->cached_error_name_val); | 16878 | result->value = err->cached_error_name_val; |
| 16881 | result->value->type = str_type; | | |
| 16882 | return result; | 16879 | return result; |
| 16883 | } | 16880 | } |
| 16884 | | 16881 | |
| 16885 | ira->codegen->generate_error_name_table = true; | 16882 | ira->codegen->generate_error_name_table = true; |
| 16886 | | 16883 | |
| | 16884 | ZigType *u8_ptr_type = get_pointer_to_type_extra2(ira->codegen, ira->codegen->builtin_types.entry_u8, |
| | 16885 | true, false, PtrLenUnknown, 0, 0, 0, false, |
| | 16886 | VECTOR_INDEX_NONE, nullptr, ira->codegen->intern.for_zero_byte()); |
| | 16887 | ZigType *str_type = get_slice_type(ira->codegen, u8_ptr_type); |
| 16887 | return ir_build_err_name_gen(ira, &instruction->base.base, value, str_type); | 16888 | return ir_build_err_name_gen(ira, &instruction->base.base, value, str_type); |
| 16888 | } | 16889 | } |
| 16889 | | 16890 | |
| ... | @@ -16898,8 +16899,9 @@ static IrInstGen *ir_analyze_instruction_enum_tag_name(IrAnalyze *ira, IrInstSrc | ... | @@ -16898,8 +16899,9 @@ static IrInstGen *ir_analyze_instruction_enum_tag_name(IrAnalyze *ira, IrInstSrc |
| 16898 | if (target_type->id == ZigTypeIdEnumLiteral) { | 16899 | if (target_type->id == ZigTypeIdEnumLiteral) { |
| 16899 | IrInstGen *result = ir_const(ira, &instruction->base.base, nullptr); | 16900 | IrInstGen *result = ir_const(ira, &instruction->base.base, nullptr); |
| 16900 | Buf *field_name = target->value->data.x_enum_literal; | 16901 | Buf *field_name = target->value->data.x_enum_literal; |
| 16901 | ZigValue *array_val = create_const_str_lit(ira->codegen, field_name)->data.x_ptr.data.ref.pointee; | 16902 | result->value = create_sentineled_str_lit( |
| 16902 | init_const_slice(ira->codegen, result->value, array_val, 0, buf_len(field_name), true); | 16903 | ira->codegen, field_name, |
| | 16904 | ira->codegen->intern.for_zero_byte()); |
| 16903 | return result; | 16905 | return result; |
| 16904 | } | 16906 | } |
| 16905 | | 16907 | |
| ... | @@ -16918,9 +16920,10 @@ static IrInstGen *ir_analyze_instruction_enum_tag_name(IrAnalyze *ira, IrInstSrc | ... | @@ -16918,9 +16920,10 @@ static IrInstGen *ir_analyze_instruction_enum_tag_name(IrAnalyze *ira, IrInstSrc |
| 16918 | | 16920 | |
| 16919 | if (can_fold_enum_type(target_type)) { | 16921 | if (can_fold_enum_type(target_type)) { |
| 16920 | TypeEnumField *only_field = &target_type->data.enumeration.fields[0]; | 16922 | TypeEnumField *only_field = &target_type->data.enumeration.fields[0]; |
| 16921 | ZigValue *array_val = create_const_str_lit(ira->codegen, only_field->name)->data.x_ptr.data.ref.pointee; | | |
| 16922 | IrInstGen *result = ir_const(ira, &instruction->base.base, nullptr); | 16923 | IrInstGen *result = ir_const(ira, &instruction->base.base, nullptr); |
| 16923 | init_const_slice(ira->codegen, result->value, array_val, 0, buf_len(only_field->name), true); | 16924 | result->value = create_sentineled_str_lit( |
| | 16925 | ira->codegen, only_field->name, |
| | 16926 | ira->codegen->intern.for_zero_byte()); |
| 16924 | return result; | 16927 | return result; |
| 16925 | } | 16928 | } |
| 16926 | | 16929 | |
| ... | @@ -16936,16 +16939,17 @@ static IrInstGen *ir_analyze_instruction_enum_tag_name(IrAnalyze *ira, IrInstSrc | ... | @@ -16936,16 +16939,17 @@ static IrInstGen *ir_analyze_instruction_enum_tag_name(IrAnalyze *ira, IrInstSrc |
| 16936 | buf_sprintf("no tag by value %s", buf_ptr(int_buf))); | 16939 | buf_sprintf("no tag by value %s", buf_ptr(int_buf))); |
| 16937 | return ira->codegen->invalid_inst_gen; | 16940 | return ira->codegen->invalid_inst_gen; |
| 16938 | } | 16941 | } |
| 16939 | ZigValue *array_val = create_const_str_lit(ira->codegen, field->name)->data.x_ptr.data.ref.pointee; | | |
| 16940 | IrInstGen *result = ir_const(ira, &instruction->base.base, nullptr); | 16942 | IrInstGen *result = ir_const(ira, &instruction->base.base, nullptr); |
| 16941 | init_const_slice(ira->codegen, result->value, array_val, 0, buf_len(field->name), true); | 16943 | result->value = create_sentineled_str_lit( |
| | 16944 | ira->codegen, field->name, |
| | 16945 | ira->codegen->intern.for_zero_byte()); |
| 16942 | return result; | 16946 | return result; |
| 16943 | } | 16947 | } |
| 16944 | | 16948 | |
| 16945 | ZigType *u8_ptr_type = get_pointer_to_type_extra( | 16949 | ZigType *u8_ptr_type = get_pointer_to_type_extra2( |
| 16946 | ira->codegen, ira->codegen->builtin_types.entry_u8, | 16950 | ira->codegen, ira->codegen->builtin_types.entry_u8, |
| 16947 | true, false, PtrLenUnknown, | 16951 | true, false, PtrLenUnknown, 0, 0, 0, false, |
| 16948 | 0, 0, 0, false); | 16952 | VECTOR_INDEX_NONE, nullptr, ira->codegen->intern.for_zero_byte()); |
| 16949 | ZigType *result_type = get_slice_type(ira->codegen, u8_ptr_type); | 16953 | ZigType *result_type = get_slice_type(ira->codegen, u8_ptr_type); |
| 16950 | return ir_build_tag_name_gen(ira, &instruction->base.base, target, result_type); | 16954 | return ir_build_tag_name_gen(ira, &instruction->base.base, target, result_type); |
| 16951 | } | 16955 | } |
| ... | @@ -17249,7 +17253,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa | ... | @@ -17249,7 +17253,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); | 17253 | declaration_array->type = get_array_type(ira->codegen, type_info_declaration_type, declaration_count, nullptr); |
| 17250 | declaration_array->data.x_array.special = ConstArraySpecialNone; | 17254 | 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); | 17255 | 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); | 17256 | init_const_slice(ira->codegen, out_val, declaration_array, 0, declaration_count, false, nullptr); |
| 17253 | | 17257 | |
| 17254 | // Loop through the declarations and generate info. | 17258 | // Loop through the declarations and generate info. |
| 17255 | decl_it = decls_scope->decl_table.entry_iterator(); | 17259 | decl_it = decls_scope->decl_table.entry_iterator(); |
| ... | @@ -17272,7 +17276,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa | ... | @@ -17272,7 +17276,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa |
| 17272 | | 17276 | |
| 17273 | ZigValue **inner_fields = alloc_const_vals_ptrs(ira->codegen, 3); | 17277 | 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; | 17278 | 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); | 17279 | init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(curr_entry->key), true, nullptr); |
| 17276 | inner_fields[1]->special = ConstValSpecialStatic; | 17280 | inner_fields[1]->special = ConstValSpecialStatic; |
| 17277 | inner_fields[1]->type = ira->codegen->builtin_types.entry_bool; | 17281 | inner_fields[1]->type = ira->codegen->builtin_types.entry_bool; |
| 17278 | inner_fields[1]->data.x_bool = curr_entry->value->visib_mod == VisibModPub; | 17282 | inner_fields[1]->data.x_bool = curr_entry->value->visib_mod == VisibModPub; |
| ... | @@ -17368,7 +17372,7 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa | ... | @@ -17368,7 +17372,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) { | 17372 | 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>(); | 17373 | 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; | 17374 | 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); | 17375 | 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); | 17376 | set_optional_payload(fn_decl_fields[5], slice_val); |
| 17373 | } else { | 17377 | } else { |
| 17374 | set_optional_payload(fn_decl_fields[5], nullptr); | 17378 | set_optional_payload(fn_decl_fields[5], nullptr); |
| ... | @@ -17388,14 +17392,14 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa | ... | @@ -17388,14 +17392,14 @@ static Error ir_make_type_info_decls(IrAnalyze *ira, IrInst* source_instr, ZigVa |
| 17388 | fn_arg_name_array->data.x_array.special = ConstArraySpecialNone; | 17392 | 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); | 17393 | fn_arg_name_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(fn_arg_count); |
| 17390 | | 17394 | |
| 17391 | init_const_slice(ira->codegen, fn_decl_fields[7], fn_arg_name_array, 0, fn_arg_count, false); | 17395 | init_const_slice(ira->codegen, fn_decl_fields[7], fn_arg_name_array, 0, fn_arg_count, false, nullptr); |
| 17392 | | 17396 | |
| 17393 | for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) { | 17397 | 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); | 17398 | 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]; | 17399 | 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, | 17400 | ZigValue *arg_name = create_const_str_lit(ira->codegen, |
| 17397 | buf_create_from_str(arg_var->name))->data.x_ptr.data.ref.pointee; | 17401 | 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); | 17402 | 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; | 17403 | fn_arg_name_val->parent.id = ConstParentIdArray; |
| 17400 | fn_arg_name_val->parent.data.p_array.array_val = fn_arg_name_array; | 17404 | 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; | 17405 | fn_arg_name_val->parent.data.p_array.elem_index = fn_arg_index; |
| ... | @@ -17531,7 +17535,7 @@ static void make_enum_field_val(IrAnalyze *ira, ZigValue *enum_field_val, TypeEn | ... | @@ -17531,7 +17535,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; | 17535 | inner_fields[1]->type = ira->codegen->builtin_types.entry_num_lit_int; |
| 17532 | | 17536 | |
| 17533 | ZigValue *name = create_const_str_lit(ira->codegen, enum_field->name)->data.x_ptr.data.ref.pointee; | 17537 | 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); | 17538 | init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(enum_field->name), true, nullptr); |
| 17535 | | 17539 | |
| 17536 | bigint_init_bigint(&inner_fields[1]->data.x_bigint, &enum_field->value); | 17540 | bigint_init_bigint(&inner_fields[1]->data.x_bigint, &enum_field->value); |
| 17537 | | 17541 | |
| ... | @@ -17732,7 +17736,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy | ... | @@ -17732,7 +17736,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy |
| 17732 | enum_field_array->data.x_array.special = ConstArraySpecialNone; | 17736 | 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); | 17737 | enum_field_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(enum_field_count); |
| 17734 | | 17738 | |
| 17735 | init_const_slice(ira->codegen, fields[2], enum_field_array, 0, enum_field_count, false); | 17739 | init_const_slice(ira->codegen, fields[2], enum_field_array, 0, enum_field_count, false, nullptr); |
| 17736 | | 17740 | |
| 17737 | for (uint32_t enum_field_index = 0; enum_field_index < enum_field_count; enum_field_index++) | 17741 | for (uint32_t enum_field_index = 0; enum_field_index < enum_field_count; enum_field_index++) |
| 17738 | { | 17742 | { |
| ... | @@ -17785,7 +17789,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy | ... | @@ -17785,7 +17789,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy |
| 17785 | error_array->data.x_array.special = ConstArraySpecialNone; | 17789 | 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); | 17790 | error_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(error_count); |
| 17787 | | 17791 | |
| 17788 | init_const_slice(ira->codegen, slice_val, error_array, 0, error_count, false); | 17792 | 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++) { | 17793 | for (uint32_t error_index = 0; error_index < error_count; error_index++) { |
| 17790 | ErrorTableEntry *error = type_entry->data.error_set.errors[error_index]; | 17794 | 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]; | 17795 | ZigValue *error_val = &error_array->data.x_array.data.s_none.elements[error_index]; |
| ... | @@ -17800,7 +17804,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy | ... | @@ -17800,7 +17804,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy |
| 17800 | name = error->cached_error_name_val; | 17804 | name = error->cached_error_name_val; |
| 17801 | if (name == nullptr) | 17805 | if (name == nullptr) |
| 17802 | name = create_const_str_lit(ira->codegen, &error->name)->data.x_ptr.data.ref.pointee; | 17806 | 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); | 17807 | init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(&error->name), true, nullptr); |
| 17804 | | 17808 | |
| 17805 | error_val->data.x_struct.fields = inner_fields; | 17809 | error_val->data.x_struct.fields = inner_fields; |
| 17806 | error_val->parent.id = ConstParentIdArray; | 17810 | error_val->parent.id = ConstParentIdArray; |
| ... | @@ -17881,7 +17885,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy | ... | @@ -17881,7 +17885,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy |
| 17881 | union_field_array->data.x_array.special = ConstArraySpecialNone; | 17885 | 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); | 17886 | union_field_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(union_field_count); |
| 17883 | | 17887 | |
| 17884 | init_const_slice(ira->codegen, fields[2], union_field_array, 0, union_field_count, false); | 17888 | init_const_slice(ira->codegen, fields[2], union_field_array, 0, union_field_count, false, nullptr); |
| 17885 | | 17889 | |
| 17886 | for (uint32_t union_field_index = 0; union_field_index < union_field_count; union_field_index++) { | 17890 | 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]; | 17891 | TypeUnionField *union_field = &type_entry->data.unionation.fields[union_field_index]; |
| ... | @@ -17902,7 +17906,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy | ... | @@ -17902,7 +17906,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); | 17906 | bigint_init_unsigned(&inner_fields[2]->data.x_bigint, union_field->align); |
| 17903 | | 17907 | |
| 17904 | ZigValue *name = create_const_str_lit(ira->codegen, union_field->name)->data.x_ptr.data.ref.pointee; | 17908 | 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); | 17909 | init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(union_field->name), true, nullptr); |
| 17906 | | 17910 | |
| 17907 | union_field_val->data.x_struct.fields = inner_fields; | 17911 | union_field_val->data.x_struct.fields = inner_fields; |
| 17908 | union_field_val->parent.id = ConstParentIdArray; | 17912 | union_field_val->parent.id = ConstParentIdArray; |
| ... | @@ -17958,7 +17962,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy | ... | @@ -17958,7 +17962,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy |
| 17958 | struct_field_array->data.x_array.special = ConstArraySpecialNone; | 17962 | 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); | 17963 | struct_field_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(struct_field_count); |
| 17960 | | 17964 | |
| 17961 | init_const_slice(ira->codegen, fields[1], struct_field_array, 0, struct_field_count, false); | 17965 | init_const_slice(ira->codegen, fields[1], struct_field_array, 0, struct_field_count, false, nullptr); |
| 17962 | | 17966 | |
| 17963 | for (uint32_t struct_field_index = 0; struct_field_index < struct_field_count; struct_field_index++) { | 17967 | 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]; | 17968 | TypeStructField *struct_field = type_entry->data.structure.fields[struct_field_index]; |
| ... | @@ -17994,7 +17998,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy | ... | @@ -17994,7 +17998,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); | 17998 | bigint_init_unsigned(&inner_fields[4]->data.x_bigint, struct_field->align); |
| 17995 | | 17999 | |
| 17996 | ZigValue *name = create_const_str_lit(ira->codegen, struct_field->name)->data.x_ptr.data.ref.pointee; | 18000 | 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); | 18001 | init_const_slice(ira->codegen, inner_fields[0], name, 0, buf_len(struct_field->name), true, nullptr); |
| 17998 | | 18002 | |
| 17999 | struct_field_val->data.x_struct.fields = inner_fields; | 18003 | struct_field_val->data.x_struct.fields = inner_fields; |
| 18000 | struct_field_val->parent.id = ConstParentIdArray; | 18004 | struct_field_val->parent.id = ConstParentIdArray; |
| ... | @@ -18074,7 +18078,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy | ... | @@ -18074,7 +18078,7 @@ static Error ir_make_type_info_value(IrAnalyze *ira, IrInst* source_instr, ZigTy |
| 18074 | fn_arg_array->data.x_array.special = ConstArraySpecialNone; | 18078 | 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); | 18079 | fn_arg_array->data.x_array.data.s_none.elements = ira->codegen->pass1_arena->allocate<ZigValue>(fn_arg_count); |
| 18076 | | 18080 | |
| 18077 | init_const_slice(ira->codegen, fields[5], fn_arg_array, 0, fn_arg_count, false); | 18081 | init_const_slice(ira->codegen, fields[5], fn_arg_array, 0, fn_arg_count, false, nullptr); |
| 18078 | | 18082 | |
| 18079 | for (size_t fn_arg_index = 0; fn_arg_index < fn_arg_count; fn_arg_index++) { | 18083 | 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]; | 18084 | FnTypeParamInfo *fn_param_info = &type_entry->data.fn.fn_type_id.param_info[fn_arg_index]; |
| ... | @@ -24150,7 +24154,7 @@ static IrInstGen *ir_analyze_instruction_src(IrAnalyze *ira, IrInstSrcSrc *instr | ... | @@ -24150,7 +24154,7 @@ static IrInstGen *ir_analyze_instruction_src(IrAnalyze *ira, IrInstSrcSrc *instr |
| 24150 | RootStruct *root_struct = import->data.structure.root_struct; | 24154 | RootStruct *root_struct = import->data.structure.root_struct; |
| 24151 | Buf *path = root_struct->path; | 24155 | Buf *path = root_struct->path; |
| 24152 | ZigValue *file_name = create_const_str_lit(ira->codegen, path)->data.x_ptr.data.ref.pointee; | 24156 | 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); | 24157 | init_const_slice(ira->codegen, fields[0], file_name, 0, buf_len(path), true, nullptr); |
| 24154 | fields[0]->type = u8_slice; | 24158 | fields[0]->type = u8_slice; |
| 24155 | | 24159 | |
| 24156 | // fn_name: [:0]const u8 | 24160 | // fn_name: [:0]const u8 |
| ... | @@ -24158,7 +24162,7 @@ static IrInstGen *ir_analyze_instruction_src(IrAnalyze *ira, IrInstSrcSrc *instr | ... | @@ -24158,7 +24162,7 @@ static IrInstGen *ir_analyze_instruction_src(IrAnalyze *ira, IrInstSrcSrc *instr |
| 24158 | fields[1]->special = ConstValSpecialStatic; | 24162 | fields[1]->special = ConstValSpecialStatic; |
| 24159 | | 24163 | |
| 24160 | ZigValue *fn_name = create_const_str_lit(ira->codegen, &fn_entry->symbol_name)->data.x_ptr.data.ref.pointee; | 24164 | 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); | 24165 | init_const_slice(ira->codegen, fields[1], fn_name, 0, buf_len(&fn_entry->symbol_name), true, nullptr); |
| 24162 | fields[1]->type = u8_slice; | 24166 | fields[1]->type = u8_slice; |
| 24163 | | 24167 | |
| 24164 | | 24168 | |