aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2023-06-07 02:20:06 +0100
committerGitHub <noreply@github.com>2023-06-07 02:20:06 +0100
commit907ef82d4b32b3ec1d4958a505c2b4445e219ee4 (patch)
tree5e2ca080af929ec750e0192ced8737e16c54e99c /src/llvm_backend_expr.cpp
parent6a2ff3a3711e3da6bc9f2be9d9a67361b3ff9bd5 (diff)
parent7a1ab62987e2c980261f9d4fa10f5677d84dc4c9 (diff)
Merge pull request #2470 from odin-lang/separate-int-word-sizes
Separate int size from word/pointer size
Diffstat (limited to 'src/llvm_backend_expr.cpp')
-rw-r--r--src/llvm_backend_expr.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp
index 143e38a8d..f95e351ce 100644
--- a/src/llvm_backend_expr.cpp
+++ b/src/llvm_backend_expr.cpp
@@ -518,7 +518,7 @@ gb_internal bool lb_is_matrix_simdable(Type *t) {
return true;
case TargetArch_i386:
case TargetArch_wasm32:
- case TargetArch_wasm64:
+ case TargetArch_wasm64p32:
return false;
}
}
@@ -4230,11 +4230,12 @@ gb_internal lbAddr lb_build_addr_compound_lit(lbProcedure *p, Ast *expr) {
lbValue count = {};
count.type = t_int;
+ unsigned len_index = lb_convert_struct_index(p->module, type, 1);
if (lb_is_const(slice)) {
- unsigned indices[1] = {1};
+ unsigned indices[1] = {len_index};
count.value = LLVMConstExtractValue(slice.value, indices, gb_count_of(indices));
} else {
- count.value = LLVMBuildExtractValue(p->builder, slice.value, 1, "");
+ count.value = LLVMBuildExtractValue(p->builder, slice.value, len_index, "");
}
lb_fill_slice(p, v, data, count);
}