diff options
| author | gingerBill <bill@gingerbill.org> | 2021-10-29 00:13:22 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-10-29 00:13:22 +0100 |
| commit | 7b8b2f042ccffc55ecdfa784a7374cd87d4f5dbc (patch) | |
| tree | 5515c87ef8d05747996d38370d68ccd2a860cb80 /src | |
| parent | ef29ffeb21bbe7f84e5c0e71cdef546ccf292432 (diff) | |
Add debug type information for `matrix`
Diffstat (limited to 'src')
| -rw-r--r-- | src/llvm_backend_debug.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/llvm_backend_debug.cpp b/src/llvm_backend_debug.cpp index 83b6ac4ae..1d14de32e 100644 --- a/src/llvm_backend_debug.cpp +++ b/src/llvm_backend_debug.cpp @@ -437,6 +437,20 @@ LLVMMetadataRef lb_debug_type_internal(lbModule *m, Type *type) { gbString name = type_to_string(type, temporary_allocator()); return LLVMDIBuilderCreateStructType(m->debug_builder, nullptr, name, gb_string_length(name), nullptr, 0, 2*word_bits, word_bits, LLVMDIFlagZero, nullptr, elements, element_count, 0, nullptr, "", 0); } + + case Type_Matrix: { + LLVMMetadataRef subscripts[1] = {}; + subscripts[0] = LLVMDIBuilderGetOrCreateSubrange(m->debug_builder, + 0ll, + matrix_type_total_internal_elems(type) + ); + + return LLVMDIBuilderCreateArrayType(m->debug_builder, + 8*cast(uint64_t)type_size_of(type), + 8*cast(unsigned)type_align_of(type), + lb_debug_type(m, type->Matrix.elem), + subscripts, gb_count_of(subscripts)); + } } GB_PANIC("Invalid type %s", type_to_string(type)); |