aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_proc.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-08-02 11:00:15 +0100
committergingerBill <gingerBill@users.noreply.github.com>2025-08-02 11:00:15 +0100
commit2561427dd396a69cd49eb02c0814c4e8e8b3a08f (patch)
treed390c6fe5c43b9469c312ebb2af07215eaf92fe1 /src/llvm_backend_proc.cpp
parent710203eadb605b41e652084297cde54754008b87 (diff)
Add `string16` and `cstring16` (UTF-16 based strings)
Diffstat (limited to 'src/llvm_backend_proc.cpp')
-rw-r--r--src/llvm_backend_proc.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/llvm_backend_proc.cpp b/src/llvm_backend_proc.cpp
index e63c92f6f..8f306b771 100644
--- a/src/llvm_backend_proc.cpp
+++ b/src/llvm_backend_proc.cpp
@@ -2289,6 +2289,10 @@ gb_internal lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValu
}
if (is_type_cstring(t)) {
return lb_cstring_len(p, v);
+ } else if (is_type_cstring16(t)) {
+ return lb_cstring16_len(p, v);
+ } else if (is_type_string16(t)) {
+ return lb_string_len(p, v);
} else if (is_type_string(t)) {
return lb_string_len(p, v);
} else if (is_type_array(t)) {
@@ -2728,6 +2732,11 @@ gb_internal lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValu
res = lb_emit_conv(p, res, tv.type);
} else if (t->Basic.kind == Basic_cstring) {
res = lb_emit_conv(p, x, tv.type);
+ } else if (t->Basic.kind == Basic_string16) {
+ res = lb_string_elem(p, x);
+ res = lb_emit_conv(p, res, tv.type);
+ } else if (t->Basic.kind == Basic_cstring16) {
+ res = lb_emit_conv(p, x, tv.type);
}
break;
case Type_Pointer: