aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2020-09-29 09:33:55 -0400
committerMatt Arsenault <Matthew.Arsenault@amd.com>2020-10-16 11:05:02 -0400
commit0a7cd99a702595ccf73c957be0127af9f25fb9a2 (patch)
tree01837b082bd0229afc320b4371fe3558b1a9758f /clang/lib/CodeGen/CGCall.cpp
parent97533b10b27db058cc77c81a4f964b66392871c6 (diff)
downloadllvm-0a7cd99a702595ccf73c957be0127af9f25fb9a2.zip
llvm-0a7cd99a702595ccf73c957be0127af9f25fb9a2.tar.gz
llvm-0a7cd99a702595ccf73c957be0127af9f25fb9a2.tar.bz2
Reapply "OpaquePtr: Add type to sret attribute"
This reverts commit eb9f7c28e5fe6d75fed3587023e17f2997c8024b. Previously this was incorrectly handling linking of the contained type, so this merges the fixes from D88973.
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 0d050dc..93be1b8 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -2139,7 +2139,7 @@ void CodeGenModule::ConstructAttributeList(
// Attach attributes to sret.
if (IRFunctionArgs.hasSRetArg()) {
llvm::AttrBuilder SRETAttrs;
- SRETAttrs.addAttribute(llvm::Attribute::StructRet);
+ SRETAttrs.addStructRetAttr(getTypes().ConvertTypeForMem(RetTy));
hasUsedSRet = true;
if (RetAI.getInReg())
SRETAttrs.addAttribute(llvm::Attribute::InReg);
@@ -2274,7 +2274,7 @@ void CodeGenModule::ConstructAttributeList(
// Add 'sret' if we haven't already used it for something, but
// only if the result is void.
if (!hasUsedSRet && RetTy->isVoidType()) {
- Attrs.addAttribute(llvm::Attribute::StructRet);
+ Attrs.addStructRetAttr(getTypes().ConvertTypeForMem(ParamType));
hasUsedSRet = true;
}