diff options
| author | elusivePorpoise <95202750+elusivePorpoise@users.noreply.github.com> | 2022-10-11 02:20:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-11 02:20:30 -0700 |
| commit | 721486f875032047b13b1a3b5dda3201951e1d3a (patch) | |
| tree | 97def1f4a86eb267919b4a90862d33724e7964b6 /src/llvm_abi.cpp | |
| parent | 8b06fd093518c01c896e4eb2bcb271a5bc593b7e (diff) | |
| parent | 29f2ecd2280106cb917ed2e2d5eb0be3448d3c5c (diff) | |
Merge branch 'odin-lang:master' into master
Diffstat (limited to 'src/llvm_abi.cpp')
| -rw-r--r-- | src/llvm_abi.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp index 4bdc31077..0654ed82a 100644 --- a/src/llvm_abi.cpp +++ b/src/llvm_abi.cpp @@ -550,10 +550,10 @@ namespace lbAbiAmd64SysV { if (is_mem_cls(cls, attribute_kind)) { LLVMAttributeRef attribute = nullptr; if (attribute_kind == Amd64TypeAttribute_ByVal) { - if (!is_calling_convention_odin(calling_convention)) { + // if (!is_calling_convention_odin(calling_convention)) { return lb_arg_type_indirect_byval(c, type); - } - attribute = nullptr; + // } + // attribute = nullptr; } else if (attribute_kind == Amd64TypeAttribute_StructRect) { attribute = lb_create_enum_attribute_with_type(c, "sret", type); } @@ -982,13 +982,13 @@ namespace lbAbiArm64 { } return false; } - - unsigned is_homogenous_aggregate_small_enough(LLVMTypeRef *base_type_, unsigned member_count_) { - return (member_count_ <= 4); - } + + unsigned is_homogenous_aggregate_small_enough(LLVMTypeRef base_type, unsigned member_count) { + return (member_count <= 4); + } lbArgType compute_return_type(LLVMContextRef c, LLVMTypeRef type, bool return_is_defined) { - LLVMTypeRef homo_base_type = {}; + LLVMTypeRef homo_base_type = nullptr; unsigned homo_member_count = 0; if (!return_is_defined) { @@ -996,16 +996,16 @@ namespace lbAbiArm64 { } else if (is_register(type)) { return non_struct(c, type); } else if (is_homogenous_aggregate(c, type, &homo_base_type, &homo_member_count)) { - if(is_homogenous_aggregate_small_enough(&homo_base_type, homo_member_count)) { - return lb_arg_type_direct(type, LLVMArrayType(homo_base_type, homo_member_count), nullptr, nullptr); - } else { - //TODO(Platin): do i need to create stuff that can handle the diffrent return type? - // else this needs a fix in llvm_backend_proc as we would need to cast it to the correct array type - - //LLVMTypeRef array_type = LLVMArrayType(homo_base_type, homo_member_count); - LLVMAttributeRef attr = lb_create_enum_attribute_with_type(c, "sret", type); - return lb_arg_type_indirect(type, attr); - } + if (is_homogenous_aggregate_small_enough(homo_base_type, homo_member_count)) { + return lb_arg_type_direct(type, LLVMArrayType(homo_base_type, homo_member_count), nullptr, nullptr); + } else { + //TODO(Platin): do i need to create stuff that can handle the diffrent return type? + // else this needs a fix in llvm_backend_proc as we would need to cast it to the correct array type + + //LLVMTypeRef array_type = LLVMArrayType(homo_base_type, homo_member_count); + LLVMAttributeRef attr = lb_create_enum_attribute_with_type(c, "sret", type); + return lb_arg_type_indirect(type, attr); + } } else { i64 size = lb_sizeof(type); if (size <= 16) { |