aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-06-20 16:00:17 +0100
committergingerBill <bill@gingerbill.org>2022-06-20 16:00:17 +0100
commit33d96fd28a107d55aacba87a6ed91ce60c9c41b8 (patch)
tree2e6a6287d532585e9f10f1749590a7c401770627
parentf1e8738af260dda0d7b5936d4f2bdbdc16ed7bbf (diff)
Correct debug information of #simd vectors
-rw-r--r--src/llvm_backend_debug.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/llvm_backend_debug.cpp b/src/llvm_backend_debug.cpp
index b91f32bfc..45a868581 100644
--- a/src/llvm_backend_debug.cpp
+++ b/src/llvm_backend_debug.cpp
@@ -419,7 +419,18 @@ LLVMMetadataRef lb_debug_type_internal(lbModule *m, Type *type) {
break;
case Type_SimdVector:
- return LLVMDIBuilderCreateVectorType(m->debug_builder, cast(unsigned)type->SimdVector.count, 8*cast(unsigned)type_align_of(type), lb_debug_type(m, type->SimdVector.elem), nullptr, 0);
+ {
+ LLVMMetadataRef elem = lb_debug_type(m, type->SimdVector.elem);
+ LLVMMetadataRef subscripts[1] = {};
+ subscripts[0] = LLVMDIBuilderGetOrCreateSubrange(m->debug_builder,
+ 0ll,
+ type->SimdVector.count
+ );
+ return LLVMDIBuilderCreateVectorType(
+ m->debug_builder,
+ 8*cast(unsigned)type_size_of(type), 8*cast(unsigned)type_align_of(type),
+ elem, subscripts, gb_count_of(subscripts));
+ }
case Type_RelativePointer: {
LLVMMetadataRef base_integer = lb_debug_type(m, type->RelativePointer.base_integer);