diff options
author | John McCall <rjmccall@apple.com> | 2018-01-07 06:28:49 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2018-01-07 06:28:49 +0000 |
commit | 56331e28648458aa9482dfab4c10e81b30f9e05c (patch) | |
tree | 47117170ab2576ee060226791c9c00a812b0bfbc /clang/lib/CodeGen/TargetInfo.cpp | |
parent | d0859a03b560629f58498d1346e1c47ae32c6cc1 (diff) | |
download | llvm-56331e28648458aa9482dfab4c10e81b30f9e05c.zip llvm-56331e28648458aa9482dfab4c10e81b30f9e05c.tar.gz llvm-56331e28648458aa9482dfab4c10e81b30f9e05c.tar.bz2 |
Simplify the internal API for checking whether swiftcall passes a type indirectly and expose that API externally.
llvm-svn: 321957
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 4b80064..e3f3ba1 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -1028,8 +1028,7 @@ public: IsMCUABI(CGT.getTarget().getTriple().isOSIAMCU()), DefaultNumRegisterParameters(NumRegisterParameters) {} - bool shouldPassIndirectlyForSwift(CharUnits totalSize, - ArrayRef<llvm::Type*> scalars, + bool shouldPassIndirectlyForSwift(ArrayRef<llvm::Type*> scalars, bool asReturnValue) const override { // LLVM's x86-32 lowering currently only assigns up to three // integer registers and three fp registers. Oddly, it'll use up to @@ -2168,8 +2167,7 @@ public: return Has64BitPointers; } - bool shouldPassIndirectlyForSwift(CharUnits totalSize, - ArrayRef<llvm::Type*> scalars, + bool shouldPassIndirectlyForSwift(ArrayRef<llvm::Type*> scalars, bool asReturnValue) const override { return occupiesMoreThan(CGT, scalars, /*total*/ 4); } @@ -2201,8 +2199,7 @@ public: return isX86VectorCallAggregateSmallEnough(NumMembers); } - bool shouldPassIndirectlyForSwift(CharUnits totalSize, - ArrayRef<llvm::Type *> scalars, + bool shouldPassIndirectlyForSwift(ArrayRef<llvm::Type *> scalars, bool asReturnValue) const override { return occupiesMoreThan(CGT, scalars, /*total*/ 4); } @@ -4922,8 +4919,7 @@ private: Address EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty) const override; - bool shouldPassIndirectlyForSwift(CharUnits totalSize, - ArrayRef<llvm::Type*> scalars, + bool shouldPassIndirectlyForSwift(ArrayRef<llvm::Type*> scalars, bool asReturnValue) const override { return occupiesMoreThan(CGT, scalars, /*total*/ 4); } @@ -5521,8 +5517,7 @@ private: llvm::CallingConv::ID getABIDefaultCC() const; void setCCs(); - bool shouldPassIndirectlyForSwift(CharUnits totalSize, - ArrayRef<llvm::Type*> scalars, + bool shouldPassIndirectlyForSwift(ArrayRef<llvm::Type*> scalars, bool asReturnValue) const override { return occupiesMoreThan(CGT, scalars, /*total*/ 4); } @@ -6313,8 +6308,7 @@ public: Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty) const override; - bool shouldPassIndirectlyForSwift(CharUnits totalSize, - ArrayRef<llvm::Type*> scalars, + bool shouldPassIndirectlyForSwift(ArrayRef<llvm::Type*> scalars, bool asReturnValue) const override { return occupiesMoreThan(CGT, scalars, /*total*/ 4); } |