diff options
author | Manman Ren <manman.ren@gmail.com> | 2016-03-29 17:37:21 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2016-03-29 17:37:21 +0000 |
commit | f46262e0b7a183c22b9384cd729c5fb0f05e5d38 (patch) | |
tree | a4c3cb4390adf67c3341875e7734d38230204150 /llvm/lib/Target/AArch64 | |
parent | 6e5c1fed08edf57725b9dc2e5c7ab429d25569a6 (diff) | |
download | bcm5719-llvm-f46262e0b7a183c22b9384cd729c5fb0f05e5d38.tar.gz bcm5719-llvm-f46262e0b7a183c22b9384cd729c5fb0f05e5d38.zip |
Swift Calling Convention: add swiftself attribute.
Differential Revision: http://reviews.llvm.org/D17866
llvm-svn: 264754
Diffstat (limited to 'llvm/lib/Target/AArch64')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64CallingConvention.td | 3 | ||||
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64FastISel.cpp | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64CallingConvention.td b/llvm/lib/Target/AArch64/AArch64CallingConvention.td index bb67d311f42..360c8cb4ab4 100644 --- a/llvm/lib/Target/AArch64/AArch64CallingConvention.td +++ b/llvm/lib/Target/AArch64/AArch64CallingConvention.td @@ -126,6 +126,9 @@ def CC_AArch64_DarwinPCS : CallingConv<[ // slot is 64-bit. CCIfByVal<CCPassByVal<8, 8>>, + // A SwiftSelf is passed in X9. + CCIfSwiftSelf<CCIfType<[i64], CCAssignToRegWithShadow<[X9], [W9]>>>, + CCIfConsecutiveRegs<CCCustom<"CC_AArch64_Custom_Block">>, // Handle i1, i8, i16, i32, i64, f32, f64 and v2f64 by passing in registers, diff --git a/llvm/lib/Target/AArch64/AArch64FastISel.cpp b/llvm/lib/Target/AArch64/AArch64FastISel.cpp index edc5751dca3..e08a246576d 100644 --- a/llvm/lib/Target/AArch64/AArch64FastISel.cpp +++ b/llvm/lib/Target/AArch64/AArch64FastISel.cpp @@ -2809,6 +2809,7 @@ bool AArch64FastISel::fastLowerArguments() { if (F->getAttributes().hasAttribute(Idx, Attribute::ByVal) || F->getAttributes().hasAttribute(Idx, Attribute::InReg) || F->getAttributes().hasAttribute(Idx, Attribute::StructRet) || + F->getAttributes().hasAttribute(Idx, Attribute::SwiftSelf) || F->getAttributes().hasAttribute(Idx, Attribute::Nest)) return false; @@ -3060,7 +3061,8 @@ bool AArch64FastISel::fastLowerCall(CallLoweringInfo &CLI) { return false; for (auto Flag : CLI.OutFlags) - if (Flag.isInReg() || Flag.isSRet() || Flag.isNest() || Flag.isByVal()) + if (Flag.isInReg() || Flag.isSRet() || Flag.isNest() || Flag.isByVal() || + Flag.isSwiftSelf()) return false; // Set up the argument vectors. |