summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2013-08-02 11:38:46 +0000
committerTim Northover <tnorthover@apple.com>2013-08-02 11:38:46 +0000
commit0389d883fc3614a419db65577a751f471186aacf (patch)
tree835b2f644bd450b141264c8ffd4a463a766f43a6
parentcf708c328422805ed56469f4d4db2edf255669a6 (diff)
downloadbcm5719-llvm-0389d883fc3614a419db65577a751f471186aacf.tar.gz
bcm5719-llvm-0389d883fc3614a419db65577a751f471186aacf.zip
Remove rather oddly merged logic from AArch64 commit.
We seem to have ended up with both an inlined check of permitted NEON base types and a call to a function. Since the outer if was (I believe) strictly weaker than the one in the function, there's no actual user-visible behaviour change, so no tests. llvm-svn: 187652
-rw-r--r--clang/lib/Sema/SemaType.cpp28
1 files changed, 7 insertions, 21 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index bc6b6a52fa3..9308dda8143 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -4668,29 +4668,15 @@ static void HandleNeonVectorTypeAttr(QualType& CurType,
return;
}
// Only certain element types are supported for Neon vectors.
- const BuiltinType* BTy = CurType->getAs<BuiltinType>();
- if (!BTy ||
- (VecKind == VectorType::NeonPolyVector &&
- BTy->getKind() != BuiltinType::SChar &&
- BTy->getKind() != BuiltinType::Short) ||
- (BTy->getKind() != BuiltinType::SChar &&
- BTy->getKind() != BuiltinType::UChar &&
- BTy->getKind() != BuiltinType::Short &&
- BTy->getKind() != BuiltinType::UShort &&
- BTy->getKind() != BuiltinType::Int &&
- BTy->getKind() != BuiltinType::UInt &&
- BTy->getKind() != BuiltinType::LongLong &&
- BTy->getKind() != BuiltinType::ULongLong &&
- BTy->getKind() != BuiltinType::Float)) {
- llvm::Triple::ArchType Arch =
+ llvm::Triple::ArchType Arch =
S.Context.getTargetInfo().getTriple().getArch();
- if (!isPermittedNeonBaseType(CurType, VecKind,
- Arch == llvm::Triple::aarch64)) {
- S.Diag(Attr.getLoc(), diag::err_attribute_invalid_vector_type) << CurType;
- Attr.setInvalid();
- return;
- }
+ if (!isPermittedNeonBaseType(CurType, VecKind,
+ Arch == llvm::Triple::aarch64)) {
+ S.Diag(Attr.getLoc(), diag::err_attribute_invalid_vector_type) << CurType;
+ Attr.setInvalid();
+ return;
}
+
// The total size of the vector must be 64 or 128 bits.
unsigned typeSize = static_cast<unsigned>(S.Context.getTypeSize(CurType));
unsigned numElts = static_cast<unsigned>(numEltsInt.getZExtValue());
OpenPOWER on IntegriCloud