diff options
| author | gingerBill <bill@gingerbill.org> | 2020-01-14 17:37:45 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-01-14 17:37:45 +0000 |
| commit | ae7cbd5171ef1ae1d27c354bab04c2e6d241176a (patch) | |
| tree | cb6ef66fa7c194257192a1e7c893ac46b153eca9 /src/ir.cpp | |
| parent | 04f7225ea5419adac67adf466a528de487c3dbd9 (diff) | |
Add debug info for enumerated arrays
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index de7bfef82..4630153a0 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -2664,6 +2664,20 @@ irDebugInfo *ir_add_debug_info_type(irModule *module, Type *type, Entity *e, irD return di; } + if (is_type_enumerated_array(type)) { + irDebugInfo *di = ir_alloc_debug_info(irDebugInfo_CompositeType); + di->CompositeType.size = ir_debug_size_bits(type); + di->CompositeType.align = ir_debug_align_bits(type); + di->CompositeType.tag = irDebugBasicEncoding_array_type; + di->CompositeType.array_count = (i32)type->EnumeratedArray.count; + + map_set(&module->debug_info, hash_type(type), di); + di->CompositeType.base_type = ir_add_debug_info_type(module, type->EnumeratedArray.elem, e, scope, file); + GB_ASSERT(base->kind != Type_Named); + + return di; + } + if (is_type_slice(type)) { // NOTE(lachsinc): Every slice type has its own composite type / field debug infos created. This is sorta wasteful. irDebugInfo *di = ir_alloc_debug_info(irDebugInfo_CompositeType); |