diff options
| author | gingerBill <bill@gingerbill.org> | 2021-10-02 18:12:34 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-10-02 18:12:34 +0100 |
| commit | 036fa5cb24609655094b7292b16277aca0db975d (patch) | |
| tree | 2c7a82d34aafe0353394f686cc23b6976570d4b7 /src/llvm_abi.cpp | |
| parent | 81fe50d623c1edb2df1334a2ef906bfc219bd18b (diff) | |
Correct ABI for windows with LLVM
Diffstat (limited to 'src/llvm_abi.cpp')
| -rw-r--r-- | src/llvm_abi.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp index 83de3dd84..8d3d5542f 100644 --- a/src/llvm_abi.cpp +++ b/src/llvm_abi.cpp @@ -239,7 +239,7 @@ i64 lb_alignof(LLVMTypeRef type) { case LLVMIntegerTypeKind: { unsigned w = LLVMGetIntTypeWidth(type); - return gb_clamp((w + 7)/8, 1, build_context.max_align); + return gb_clamp((w + 7)/8, 1, build_context.word_size); } case LLVMHalfTypeKind: return 2; @@ -342,7 +342,7 @@ namespace lbAbi386 { LLVMTypeRef t = arg_types[i]; LLVMTypeKind kind = LLVMGetTypeKind(t); i64 sz = lb_sizeof(t); - if (kind == LLVMStructTypeKind) { + if (kind == LLVMStructTypeKind || kind == LLVMArrayTypeKind) { if (sz == 0) { args[i] = lb_arg_type_ignore(t); } else { @@ -392,7 +392,7 @@ namespace lbAbiAmd64Win64 { for (unsigned i = 0; i < arg_count; i++) { LLVMTypeRef t = arg_types[i]; LLVMTypeKind kind = LLVMGetTypeKind(t); - if (kind == LLVMStructTypeKind) { + if (kind == LLVMStructTypeKind || kind == LLVMArrayTypeKind) { i64 sz = lb_sizeof(t); switch (sz) { case 1: |