| ... | ... | @@ -4041,6 +4041,12 @@ static void generate_enum_name_tables(CodeGen *g) { |
| 4041 | 4041 | TypeTableEntry *u8_ptr_type = get_pointer_to_type(g, g->builtin_types.entry_u8, true); |
| 4042 | 4042 | TypeTableEntry *str_type = get_slice_type(g, u8_ptr_type); |
| 4043 | 4043 | |
| 4044 | TypeTableEntry *usize = g->builtin_types.entry_usize; |
| 4045 | LLVMValueRef array_ptr_indices[] = { |
| 4046 | LLVMConstNull(usize->type_ref), |
| 4047 | LLVMConstNull(usize->type_ref), |
| 4048 | }; |
| 4049 | |
| 4044 | 4050 | |
| 4045 | 4051 | for (size_t enum_i = 0; enum_i < g->name_table_enums.length; enum_i += 1) { |
| 4046 | 4052 | TypeTableEntry *enum_tag_type = g->name_table_enums.at(enum_i); |
| ... | ... | @@ -4061,7 +4067,7 @@ static void generate_enum_name_tables(CodeGen *g) { |
| 4061 | 4067 | LLVMSetAlignment(str_global, LLVMABIAlignmentOfType(g->target_data_ref, LLVMTypeOf(str_init))); |
| 4062 | 4068 | |
| 4063 | 4069 | LLVMValueRef fields[] = { |
| 4064 | | LLVMConstBitCast(str_global, u8_ptr_type->type_ref), |
| 4070 | LLVMConstGEP(str_global, array_ptr_indices, 2), |
| 4065 | 4071 | LLVMConstInt(g->builtin_types.entry_usize->type_ref, buf_len(name), false), |
| 4066 | 4072 | }; |
| 4067 | 4073 | values[field_i] = LLVMConstNamedStruct(str_type->type_ref, fields, 2); |