| ... | ... | @@ -1272,28 +1272,28 @@ static void resolve_enum_type(CodeGen *g, TypeTableEntry *enum_type) { |
| 1272 | 1272 | if (!type_has_bits(field_type)) |
| 1273 | 1273 | continue; |
| 1274 | 1274 | |
| 1275 | | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, field_type->type_ref); |
| 1276 | | uint64_t debug_align_in_bits = 8*LLVMABIAlignmentOfType(g->target_data_ref, field_type->type_ref); |
| 1275 | uint64_t store_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, field_type->type_ref); |
| 1276 | uint64_t preferred_align_in_bits = 8*LLVMPreferredAlignmentOfType(g->target_data_ref, field_type->type_ref); |
| 1277 | 1277 | |
| 1278 | | assert(debug_size_in_bits > 0); |
| 1279 | | assert(debug_align_in_bits > 0); |
| 1278 | assert(store_size_in_bits > 0); |
| 1279 | assert(preferred_align_in_bits > 0); |
| 1280 | 1280 | |
| 1281 | 1281 | union_inner_di_types[type_enum_field->gen_index] = ZigLLVMCreateDebugMemberType(g->dbuilder, |
| 1282 | 1282 | ZigLLVMTypeToScope(enum_type->di_type), buf_ptr(type_enum_field->name), |
| 1283 | 1283 | import->di_file, (unsigned)(field_node->line + 1), |
| 1284 | | debug_size_in_bits, |
| 1285 | | debug_align_in_bits, |
| 1284 | store_size_in_bits, |
| 1285 | preferred_align_in_bits, |
| 1286 | 1286 | 0, |
| 1287 | 1287 | 0, field_type->di_type); |
| 1288 | 1288 | |
| 1289 | | biggest_size_in_bits = max(biggest_size_in_bits, debug_size_in_bits); |
| 1289 | biggest_size_in_bits = max(biggest_size_in_bits, store_size_in_bits); |
| 1290 | 1290 | |
| 1291 | 1291 | if (!most_aligned_union_member || |
| 1292 | | debug_align_in_bits > biggest_align_in_bits) |
| 1292 | preferred_align_in_bits > biggest_align_in_bits) |
| 1293 | 1293 | { |
| 1294 | 1294 | most_aligned_union_member = field_type; |
| 1295 | | biggest_align_in_bits = debug_align_in_bits; |
| 1296 | | size_of_most_aligned_member_in_bits = debug_size_in_bits; |
| 1295 | biggest_align_in_bits = preferred_align_in_bits; |
| 1296 | size_of_most_aligned_member_in_bits = store_size_in_bits; |
| 1297 | 1297 | } |
| 1298 | 1298 | } |
| 1299 | 1299 | |
| ... | ... | @@ -1326,10 +1326,8 @@ static void resolve_enum_type(CodeGen *g, TypeTableEntry *enum_type) { |
| 1326 | 1326 | } |
| 1327 | 1327 | enum_type->data.enumeration.union_type_ref = union_type_ref; |
| 1328 | 1328 | |
| 1329 | | assert(8*LLVMABIAlignmentOfType(g->target_data_ref, union_type_ref) >= |
| 1330 | | biggest_align_in_bits); |
| 1331 | | assert(8*LLVMABISizeOfType(g->target_data_ref, union_type_ref) >= |
| 1332 | | biggest_size_in_bits); |
| 1329 | assert(8*LLVMPreferredAlignmentOfType(g->target_data_ref, union_type_ref) >= biggest_align_in_bits); |
| 1330 | assert(8*LLVMStoreSizeOfType(g->target_data_ref, union_type_ref) >= biggest_size_in_bits); |
| 1333 | 1331 | |
| 1334 | 1332 | // create llvm type for root struct |
| 1335 | 1333 | LLVMTypeRef root_struct_element_types[] = { |
| ... | ... | @@ -1340,7 +1338,7 @@ static void resolve_enum_type(CodeGen *g, TypeTableEntry *enum_type) { |
| 1340 | 1338 | |
| 1341 | 1339 | // create debug type for tag |
| 1342 | 1340 | uint64_t tag_debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, tag_type_entry->type_ref); |
| 1343 | | uint64_t tag_debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, tag_type_entry->type_ref); |
| 1341 | uint64_t tag_debug_align_in_bits = 8*LLVMPreferredAlignmentOfType(g->target_data_ref, tag_type_entry->type_ref); |
| 1344 | 1342 | ZigLLVMDIType *tag_di_type = ZigLLVMCreateDebugEnumerationType(g->dbuilder, |
| 1345 | 1343 | ZigLLVMTypeToScope(enum_type->di_type), "AnonEnum", |
| 1346 | 1344 | import->di_file, (unsigned)(decl_node->line + 1), |