mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
'#no_nil' I am actually disappointed in myself
This commit is contained in:
@@ -408,8 +408,12 @@ gb_internal LLVMMetadataRef lb_debug_union(lbModule *m, Type *type, String name,
|
|||||||
lb_set_llvm_metadata(m, type, temp_forward_decl);
|
lb_set_llvm_metadata(m, type, temp_forward_decl);
|
||||||
|
|
||||||
isize index_offset = 1;
|
isize index_offset = 1;
|
||||||
|
isize variant_offset = 1;
|
||||||
if (is_type_union_maybe_pointer(bt)) {
|
if (is_type_union_maybe_pointer(bt)) {
|
||||||
index_offset = 0;
|
index_offset = 0;
|
||||||
|
variant_offset = 0;
|
||||||
|
} else if (bt->Union.kind == UnionType_no_nil) {
|
||||||
|
variant_offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVMMetadataRef member_scope = lb_get_llvm_metadata(m, bt->Union.scope);
|
LLVMMetadataRef member_scope = lb_get_llvm_metadata(m, bt->Union.scope);
|
||||||
@@ -438,13 +442,8 @@ gb_internal LLVMMetadataRef lb_debug_union(lbModule *m, Type *type, String name,
|
|||||||
for_array(j, bt->Union.variants) {
|
for_array(j, bt->Union.variants) {
|
||||||
Type *variant = bt->Union.variants[j];
|
Type *variant = bt->Union.variants[j];
|
||||||
|
|
||||||
ptrdiff_t variant_index = j;
|
|
||||||
if (bt->Union.kind != UnionType_no_nil) {
|
|
||||||
variant_index += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
char name[32] = {};
|
char name[32] = {};
|
||||||
gb_snprintf(name, gb_size_of(name), "v%td", variant_index);
|
gb_snprintf(name, gb_size_of(name), "v%td", variant_offset+j);
|
||||||
isize name_len = gb_strlen(name);
|
isize name_len = gb_strlen(name);
|
||||||
|
|
||||||
elements[index_offset+j] = LLVMDIBuilderCreateMemberType(
|
elements[index_offset+j] = LLVMDIBuilderCreateMemberType(
|
||||||
|
|||||||
Reference in New Issue
Block a user