summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2014-10-29 13:43:21 +0000
committerEli Bendersky <eliben@google.com>2014-10-29 13:43:21 +0000
commit95338a09c01f9044affaeb82d5291e9b3e02125f (patch)
tree7b64e6cc3e602767108e314c3a7d4754f413b8c7 /clang/lib
parent639728da355d9e4ce2682581cd475871178e5820 (diff)
downloadbcm5719-llvm-95338a09c01f9044affaeb82d5291e9b3e02125f.tar.gz
bcm5719-llvm-95338a09c01f9044affaeb82d5291e9b3e02125f.zip
Pass aggregates on the stack without splitting in NVPTX.
Following the NVVM IR specifications, arguments of aggregate type should be passed on the stack without splitting (byval). http://reviews.llvm.org/D6020 Patch by Jacques Pienaar. llvm-svn: 220854
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 4fcfc79abd7..44bc36f514e 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -5055,6 +5055,10 @@ ABIArgInfo NVPTXABIInfo::classifyArgumentType(QualType Ty) const {
if (const EnumType *EnumTy = Ty->getAs<EnumType>())
Ty = EnumTy->getDecl()->getIntegerType();
+ // Return aggregates type as indirect by value
+ if (isAggregateTypeForABI(Ty))
+ return ABIArgInfo::getIndirect(0, /* byval */ true);
+
return (Ty->isPromotableIntegerType() ?
ABIArgInfo::getExtend() : ABIArgInfo::getDirect());
}
OpenPOWER on IntegriCloud