summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Basic/Targets.cpp4
-rw-r--r--clang/lib/Sema/SemaType.cpp6
2 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index b31ec78c7ea..dc31ace06ca 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -3711,9 +3711,7 @@ public:
.Case("arm", true)
.Case("softfloat", SoftFloat)
.Case("thumb", IsThumb)
- .Case("neon", (FPU & NeonFPU) && !SoftFloat &&
- (StringRef(getCPUDefineSuffix(CPU)).startswith("7") ||
- StringRef(getCPUDefineSuffix(CPU)).startswith("8")))
+ .Case("neon", (FPU & NeonFPU) && !SoftFloat)
.Default(false);
}
// FIXME: Should we actually have some table instead of these switches?
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 0154a129af8..bce612a2a79 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -4735,6 +4735,12 @@ static bool isPermittedNeonBaseType(QualType &Ty,
static void HandleNeonVectorTypeAttr(QualType& CurType,
const AttributeList &Attr, Sema &S,
VectorType::VectorKind VecKind) {
+ // Target must have NEON
+ if (!S.Context.getTargetInfo().hasFeature("neon")) {
+ S.Diag(Attr.getLoc(), diag::err_attribute_unsupported) << Attr.getName();
+ Attr.setInvalid();
+ return;
+ }
// Check the attribute arguments.
if (Attr.getNumArgs() != 1) {
S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments)
OpenPOWER on IntegriCloud