aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_abi.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-02-25 11:39:46 +0000
committergingerBill <bill@gingerbill.org>2021-02-25 11:39:46 +0000
commit84deee75cc4e7b0d0d37352ce81868564821acfb (patch)
tree731afa32b92939320787ad1956d204d70471d1e5 /src/llvm_abi.cpp
parent82275082ff31fcac6faff60c8095156ddb285aa8 (diff)
Make lb_create_enum_attribute ignore certain attributes (they are not properly supported by the actual LLVM C API)
Diffstat (limited to 'src/llvm_abi.cpp')
-rw-r--r--src/llvm_abi.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp
index 6c7c681a6..1f408fa17 100644
--- a/src/llvm_abi.cpp
+++ b/src/llvm_abi.cpp
@@ -443,9 +443,7 @@ 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);
}
- LLVMAttributeRef attr = nullptr;
- // TODO(bill): sret doesn't work correct for LLVM C API
- // attr = lb_create_enum_attribute(c, "sret", true);
+ LLVMAttributeRef attr = lb_create_enum_attribute(c, "sret", true);
return lb_arg_type_indirect(return_type, attr);
}
return non_struct(c, return_type, true);
@@ -604,8 +602,7 @@ namespace lbAbiAmd64SysV {
if (attribute_kind == Amd64TypeAttribute_ByVal) {
attribute = lb_create_enum_attribute(c, "byval", true);
} else if (attribute_kind == Amd64TypeAttribute_StructRect) {
- // TODO(bill): sret doesn't work correct for LLVM C API
- // attribute = lb_create_enum_attribute(c, "sret", true);
+ attribute = lb_create_enum_attribute(c, "sret", true);
}
return lb_arg_type_indirect(type, attribute);
} else {
@@ -904,9 +901,7 @@ 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);
}
- LLVMAttributeRef attr = nullptr;
- // TODO(bill): sret doesn't work correct for LLVM C API
- // attr = lb_create_enum_attribute(c, "sret", true);
+ LLVMAttributeRef 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);
@@ -1055,9 +1050,7 @@ namespace lbAbiArm64 {
}
return lb_arg_type_direct(type, cast_type, nullptr, nullptr);
} else {
- LLVMAttributeRef attr = nullptr;
- // TODO(bill): sret doesn't work correct for LLVM C API
- // attr = lb_create_enum_attribute(c, "sret", true);
+ LLVMAttributeRef attr = lb_create_enum_attribute(c, "sret", true);
return lb_arg_type_indirect(type, attr);
}
}