summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-02-25 00:59:14 +0000
committerReid Kleckner <reid@kleckner.net>2014-02-25 00:59:14 +0000
commitfab1e89de90902e0713b8af320fc83a412ef2dad (patch)
tree921cb2409f929d4180bb4ffcbed5b94fff5366d6 /clang/lib/CodeGen/TargetInfo.cpp
parent1ce017e8cb0262730b0dcf8f722c62818752757c (diff)
downloadbcm5719-llvm-fab1e89de90902e0713b8af320fc83a412ef2dad.tar.gz
bcm5719-llvm-fab1e89de90902e0713b8af320fc83a412ef2dad.zip
MS ABI: Return sret parameters when using inalloca
Previously the X86 backend would look for the sret attribute and handle this for us. inalloca takes that all away, so we have to do the return ourselves now. llvm-svn: 202097
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 05cb21dd190..e1c586a7d28 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -1061,6 +1061,8 @@ void X86_32ABIInfo::rewriteWithInAlloca(CGFunctionInfo &FI) const {
if (Ret.isIndirect() && !Ret.getInReg()) {
CanQualType PtrTy = getContext().getPointerType(FI.getReturnType());
addFieldToArgStruct(FrameFields, StackOffset, Ret, PtrTy);
+ // On Windows, the hidden sret parameter is always returned in eax.
+ Ret.setInAllocaSRet(IsWin32StructABI);
}
// Skip the 'this' parameter in ecx.
OpenPOWER on IntegriCloud