diff options
| author | gingerBill <bill@gingerbill.org> | 2021-02-25 09:55:56 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-02-25 09:55:56 +0000 |
| commit | fc48e9638ad0a1f0a3691772c7d1e9f1cbf6fddc (patch) | |
| tree | c96c4322d40f2fff6ce59dd7b428db1729bf476c /src/llvm_abi.cpp | |
| parent | 4a69bfada164e50e71db0043782498b0a27f7040 (diff) | |
| parent | 4d13a435900c6668760b6099a998c41fa1fb1717 (diff) | |
Merge branch 'master' of https://github.com/odin-lang/Odin
Diffstat (limited to 'src/llvm_abi.cpp')
| -rw-r--r-- | src/llvm_abi.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp index 4dd48fbcc..6c7c681a6 100644 --- a/src/llvm_abi.cpp +++ b/src/llvm_abi.cpp @@ -443,7 +443,10 @@ namespace lbAbi386 { case 4: return lb_arg_type_direct(return_type, LLVMIntTypeInContext(c, 32), nullptr, nullptr); case 8: return lb_arg_type_direct(return_type, LLVMIntTypeInContext(c, 64), nullptr, nullptr); } - return lb_arg_type_indirect(return_type, lb_create_enum_attribute(c, "sret", true)); + LLVMAttributeRef attr = nullptr; + // TODO(bill): sret doesn't work correct for LLVM C API + // attr = lb_create_enum_attribute(c, "sret", true); + return lb_arg_type_indirect(return_type, attr); } return non_struct(c, return_type, true); } @@ -601,7 +604,8 @@ namespace lbAbiAmd64SysV { if (attribute_kind == Amd64TypeAttribute_ByVal) { attribute = lb_create_enum_attribute(c, "byval", true); } else if (attribute_kind == Amd64TypeAttribute_StructRect) { - attribute = lb_create_enum_attribute(c, "sret", true); + // TODO(bill): sret doesn't work correct for LLVM C API + // attribute = lb_create_enum_attribute(c, "sret", true); } return lb_arg_type_indirect(type, attribute); } else { @@ -900,7 +904,10 @@ namespace lbAbiAmd64SysV { case 4: return lb_arg_type_direct(return_type, LLVMIntTypeInContext(c, 32), nullptr, nullptr); case 8: return lb_arg_type_direct(return_type, LLVMIntTypeInContext(c, 64), nullptr, nullptr); } - return lb_arg_type_indirect(return_type, lb_create_enum_attribute(c, "sret", true)); + LLVMAttributeRef attr = nullptr; + // TODO(bill): sret doesn't work correct for LLVM C API + // attr = lb_create_enum_attribute(c, "sret", true); + return lb_arg_type_indirect(return_type, attr); } else if (build_context.metrics.os == TargetOs_windows && lb_is_type_kind(return_type, LLVMIntegerTypeKind) && lb_sizeof(return_type) == 16) { return lb_arg_type_direct(return_type, LLVMIntTypeInContext(c, 128), nullptr, nullptr); } @@ -909,7 +916,7 @@ namespace lbAbiAmd64SysV { }; -namespace lbAbiAarch64 { +namespace lbAbiArm64 { Array<lbArgType> compute_arg_types(LLVMContextRef c, LLVMTypeRef *arg_types, unsigned arg_count); lbArgType compute_return_type(LLVMContextRef c, LLVMTypeRef return_type, bool return_is_defined); bool is_homogenous_aggregate(LLVMContextRef c, LLVMTypeRef type, LLVMTypeRef *base_type_, unsigned *member_count_); @@ -1048,7 +1055,9 @@ namespace lbAbiAarch64 { } return lb_arg_type_direct(type, cast_type, nullptr, nullptr); } else { - LLVMAttributeRef attr = lb_create_enum_attribute(c, "sret", true); + LLVMAttributeRef attr = nullptr; + // TODO(bill): sret doesn't work correct for LLVM C API + // attr = lb_create_enum_attribute(c, "sret", true); return lb_arg_type_indirect(type, attr); } } @@ -1123,8 +1132,8 @@ LB_ABI_INFO(lb_get_abi_info) { } } else if (build_context.metrics.arch == TargetArch_386) { return lbAbi386::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention); - } else if (build_context.metrics.arch == TargetArch_aarch64) { - return lbAbiAarch64::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention); + } else if (build_context.metrics.arch == TargetArch_arm64) { + return lbAbiArm64::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention); } else if (build_context.metrics.arch == TargetArch_wasm32) { return lbAbi386::abi_info(c, arg_types, arg_count, return_type, return_is_defined, calling_convention); } |