From b7eebe5d004380dec34a185bca6e5e343589de69 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 14 Dec 2018 18:36:06 +0000 Subject: Fix polymorphic record types with constant value parameters --- src/ir.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index e11d1a054..c2739b387 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -606,12 +606,14 @@ struct irDebugInfo { } LexicalBlock; struct { + Type * type; String name; i32 size; i32 align; irDebugEncoding encoding; } BasicType; struct { + Type * type; irDebugEncoding tag; irDebugInfo * base_type; String name; @@ -1766,6 +1768,7 @@ irDebugInfo *ir_add_debug_info_field_internal(irModule *module, String name, Typ // "scope", if set, should be inserted into map prior to calling to ensure no cyclical dependency issues. irDebugInfo *di = ir_alloc_debug_info(irDebugInfo_DerivedType); + // GB_ASSERT_MSG(name.len > 0, "%s", type_to_string(type)); di->DerivedType.name = name; di->DerivedType.tag = irDebugBasicEncoding_member; di->DerivedType.size = ir_debug_size_bits(type); @@ -2350,9 +2353,9 @@ irDebugInfo *ir_add_debug_info_type(irModule *module, Type *type, Entity *e, irD di->CompositeType.file = file; di->CompositeType.pos = base->Union.node->UnionType.token.pos; for_array(field_index, base->Union.variants) { - array_add(&di->CompositeType.elements->DebugInfoArray.elements, - ir_add_debug_info_field(module, di, nullptr, type, cast(i32)field_index, - base->Union.variants[field_index], file)); + // TODO(bill): Union pseudo-"fields" + // irDebugInfo *di = ir_add_debug_info_field(module, di, nullptr, type, cast(i32)field_index, base->Union.variants[field_index], file); + // array_add(&di->CompositeType.elements->DebugInfoArray.elements, di); } } else if (is_type_enum(type)) { GB_ASSERT(base->kind == Type_Enum); -- cgit v1.2.3