aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_debug.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-08-02 11:55:16 +0100
committergingerBill <gingerBill@users.noreply.github.com>2025-08-02 11:55:16 +0100
commitae02d3d02d2eb5132fa7c6573ed7db20d7e18f3e (patch)
tree0f9f591df4a9862013ff79ef2e5ea3f8c050c393 /src/llvm_backend_debug.cpp
parent2561427dd396a69cd49eb02c0814c4e8e8b3a08f (diff)
Begin supporting `string16` across the core library
Diffstat (limited to 'src/llvm_backend_debug.cpp')
-rw-r--r--src/llvm_backend_debug.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/llvm_backend_debug.cpp b/src/llvm_backend_debug.cpp
index 024c5564e..182920fc7 100644
--- a/src/llvm_backend_debug.cpp
+++ b/src/llvm_backend_debug.cpp
@@ -802,6 +802,20 @@ gb_internal LLVMMetadataRef lb_debug_type_internal(lbModule *m, Type *type) {
LLVMMetadataRef char_type = lb_debug_type_basic_type(m, str_lit("char"), 8, LLVMDWARFTypeEncoding_Unsigned);
return LLVMDIBuilderCreatePointerType(m->debug_builder, char_type, ptr_bits, ptr_bits, 0, "cstring", 7);
}
+
+ case Basic_string16:
+ {
+ LLVMMetadataRef elements[2] = {};
+ elements[0] = lb_debug_struct_field(m, str_lit("data"), t_u16_ptr, 0);
+ elements[1] = lb_debug_struct_field(m, str_lit("len"), t_int, int_bits);
+ return lb_debug_basic_struct(m, str_lit("string16"), 2*int_bits, int_bits, elements, gb_count_of(elements));
+ }
+ case Basic_cstring16:
+ {
+ LLVMMetadataRef char_type = lb_debug_type_basic_type(m, str_lit("wchar_t"), 16, LLVMDWARFTypeEncoding_Unsigned);
+ return LLVMDIBuilderCreatePointerType(m->debug_builder, char_type, ptr_bits, ptr_bits, 0, "cstring16", 7);
+ }
+
case Basic_any:
{
LLVMMetadataRef elements[2] = {};