| ... | ... | @@ -6576,9 +6576,24 @@ static void resolve_llvm_types_enum(CodeGen *g, ZigType *enum_type) { |
| 6576 | 6576 | assert(enum_type->data.enumeration.complete); |
| 6577 | 6577 | if (enum_type->llvm_di_type != nullptr) return; |
| 6578 | 6578 | |
| 6579 | Scope *scope = &enum_type->data.enumeration.decls_scope->base; |
| 6580 | ZigType *import = get_scope_import(scope); |
| 6581 | AstNode *decl_node = enum_type->data.enumeration.decl_node; |
| 6582 | |
| 6579 | 6583 | if (!type_has_bits(enum_type)) { |
| 6580 | 6584 | enum_type->llvm_type = g->builtin_types.entry_void->llvm_type; |
| 6581 | | enum_type->llvm_di_type = g->builtin_types.entry_void->llvm_di_type; |
| 6585 | |
| 6586 | uint64_t debug_size_in_bits = 0; |
| 6587 | uint64_t debug_align_in_bits = 0; |
| 6588 | ZigLLVMDIType **di_element_types = nullptr; |
| 6589 | size_t debug_field_count = 0; |
| 6590 | enum_type->llvm_di_type = ZigLLVMCreateDebugStructType(g->dbuilder, |
| 6591 | ZigLLVMFileToScope(import->data.structure.root_struct->di_file), |
| 6592 | buf_ptr(&enum_type->name), |
| 6593 | import->data.structure.root_struct->di_file, (unsigned)(decl_node->line + 1), |
| 6594 | debug_size_in_bits, |
| 6595 | debug_align_in_bits, |
| 6596 | 0, nullptr, di_element_types, (int)debug_field_count, 0, nullptr, ""); |
| 6582 | 6597 | return; |
| 6583 | 6598 | } |
| 6584 | 6599 | |
| ... | ... | @@ -6587,9 +6602,6 @@ static void resolve_llvm_types_enum(CodeGen *g, ZigType *enum_type) { |
| 6587 | 6602 | assert(enum_type->data.enumeration.fields); |
| 6588 | 6603 | ZigLLVMDIEnumerator **di_enumerators = allocate<ZigLLVMDIEnumerator*>(field_count); |
| 6589 | 6604 | |
| 6590 | | Scope *scope = &enum_type->data.enumeration.decls_scope->base; |
| 6591 | | ZigType *import = get_scope_import(scope); |
| 6592 | | |
| 6593 | 6605 | for (uint32_t i = 0; i < field_count; i += 1) { |
| 6594 | 6606 | TypeEnumField *enum_field = &enum_type->data.enumeration.fields[i]; |
| 6595 | 6607 | |
| ... | ... | @@ -6603,7 +6615,6 @@ static void resolve_llvm_types_enum(CodeGen *g, ZigType *enum_type) { |
| 6603 | 6615 | enum_type->llvm_type = get_llvm_type(g, tag_int_type); |
| 6604 | 6616 | |
| 6605 | 6617 | // create debug type for tag |
| 6606 | | AstNode *decl_node = enum_type->data.enumeration.decl_node; |
| 6607 | 6618 | uint64_t tag_debug_size_in_bits = tag_int_type->size_in_bits; |
| 6608 | 6619 | uint64_t tag_debug_align_in_bits = 8*tag_int_type->abi_align; |
| 6609 | 6620 | ZigLLVMDIType *tag_di_type = ZigLLVMCreateDebugEnumerationType(g->dbuilder, |