summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorBryan Chan <bryan.chan@ca.ibm.com>2016-04-28 13:56:43 +0000
committerBryan Chan <bryan.chan@ca.ibm.com>2016-04-28 13:56:43 +0000
commite3f1ed580552ea034fba1f2097c92b06723c1783 (patch)
tree0b07a093bb1dfb873e461c2bf6ab20c7dadc431e /clang/lib/CodeGen
parent959d180fa695db7b689711e956e31ae32370635f (diff)
downloadbcm5719-llvm-e3f1ed580552ea034fba1f2097c92b06723c1783.tar.gz
bcm5719-llvm-e3f1ed580552ea034fba1f2097c92b06723c1783.zip
[SystemZ] Support Swift calling convention
Summary: Port rL265324 to SystemZ to allow using the 'swiftcall' attribute on that architecture. Depends on D19414. Reviewers: kbarton, rjmccall, uweigand Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19432 llvm-svn: 267879
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 4512f702e7e..08d6741f556 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -5713,12 +5713,12 @@ void NVPTXTargetCodeGenInfo::addNVVMMetadata(llvm::Function *F, StringRef Name,
namespace {
-class SystemZABIInfo : public ABIInfo {
+class SystemZABIInfo : public SwiftABIInfo {
bool HasVector;
public:
SystemZABIInfo(CodeGenTypes &CGT, bool HV)
- : ABIInfo(CGT), HasVector(HV) {}
+ : SwiftABIInfo(CGT), HasVector(HV) {}
bool isPromotableIntegerType(QualType Ty) const;
bool isCompoundType(QualType Ty) const;
@@ -5738,6 +5738,12 @@ public:
Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
QualType Ty) const override;
+
+ bool shouldPassIndirectlyForSwift(CharUnits totalSize,
+ ArrayRef<llvm::Type*> scalars,
+ bool asReturnValue) const override {
+ return occupiesMoreThan(CGT, scalars, /*total*/ 4);
+ }
};
class SystemZTargetCodeGenInfo : public TargetCodeGenInfo {
OpenPOWER on IntegriCloud