summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-02-19 20:57:58 +0000
committerdim <dim@FreeBSD.org>2015-02-19 20:57:58 +0000
commitdfd258880cb7da4868d2b1a3679779bc4ece5314 (patch)
treeb0d1eaed14959a7722ff246ffa303348922e9fb5 /lib/CodeGen/TargetInfo.cpp
parentff28d95d1f024411955913aaa68c17f2b09c46fd (diff)
downloadFreeBSD-src-dfd258880cb7da4868d2b1a3679779bc4ece5314.zip
FreeBSD-src-dfd258880cb7da4868d2b1a3679779bc4ece5314.tar.gz
Vendor import of clang RELEASE_360/rc4 tag r229772 (effectively, 3.6.0 RC4):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc4@229772
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r--lib/CodeGen/TargetInfo.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index 6ad3495..39cc7e5 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -2134,19 +2134,15 @@ ABIArgInfo X86_64ABIInfo::getIndirectResult(QualType Ty,
return ABIArgInfo::getIndirect(Align);
}
-/// GetByteVectorType - The ABI specifies that a value should be passed in an
-/// full vector XMM/YMM register. Pick an LLVM IR type that will be passed as a
-/// vector register.
+/// The ABI specifies that a value should be passed in a full vector XMM/YMM
+/// register. Pick an LLVM IR type that will be passed as a vector register.
llvm::Type *X86_64ABIInfo::GetByteVectorType(QualType Ty) const {
- llvm::Type *IRType = CGT.ConvertType(Ty);
+ // Wrapper structs/arrays that only contain vectors are passed just like
+ // vectors; strip them off if present.
+ if (const Type *InnerTy = isSingleElementStruct(Ty, getContext()))
+ Ty = QualType(InnerTy, 0);
- // Wrapper structs that just contain vectors are passed just like vectors,
- // strip them off if present.
- llvm::StructType *STy = dyn_cast<llvm::StructType>(IRType);
- while (STy && STy->getNumElements() == 1) {
- IRType = STy->getElementType(0);
- STy = dyn_cast<llvm::StructType>(IRType);
- }
+ llvm::Type *IRType = CGT.ConvertType(Ty);
// If the preferred type is a 16-byte vector, prefer to pass it.
if (llvm::VectorType *VT = dyn_cast<llvm::VectorType>(IRType)){
OpenPOWER on IntegriCloud