aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_abi.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-02-25 00:22:47 +0000
committergingerBill <bill@gingerbill.org>2021-02-25 00:22:47 +0000
commit58422711d1fdb6af8d4c97e375197647926df622 (patch)
tree199cbf8fc02d26d339528a0546e0069a63c5438e /src/llvm_abi.cpp
parentba817d153ce1cd48dd37e47d2e4243270f78e9f0 (diff)
Remove sret attribute in llvm_abi.cpp
Diffstat (limited to 'src/llvm_abi.cpp')
-rw-r--r--src/llvm_abi.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/llvm_abi.cpp b/src/llvm_abi.cpp
index 327165da5..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);
}
@@ -1048,7 +1055,9 @@ namespace lbAbiArm64 {
}
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);
}
}