@@ -8077,10 +8077,10 @@ static bool verifyValidIntegerConstantExpr(Sema &S, const ParsedAttr &Attr,
8077
8077
// / match one of the standard Neon vector types.
8078
8078
static void HandleNeonVectorTypeAttr (QualType &CurType, const ParsedAttr &Attr,
8079
8079
Sema &S, VectorKind VecKind) {
8080
- bool IsTargetCUDAAndHostARM = false ;
8081
- if (S.getLangOpts ().CUDAIsDevice ) {
8080
+ bool IsTargetDeviceAndHostARM = false ;
8081
+ if (S.getLangOpts ().CUDAIsDevice || S. getLangOpts (). SYCLIsDevice ) {
8082
8082
const TargetInfo *AuxTI = S.getASTContext ().getAuxTargetInfo ();
8083
- IsTargetCUDAAndHostARM =
8083
+ IsTargetDeviceAndHostARM =
8084
8084
AuxTI && (AuxTI->getTriple ().isAArch64 () || AuxTI->getTriple ().isARM ());
8085
8085
}
8086
8086
@@ -8090,7 +8090,7 @@ static void HandleNeonVectorTypeAttr(QualType &CurType, const ParsedAttr &Attr,
8090
8090
S.Context .getTargetInfo ().hasFeature (" mve" ) ||
8091
8091
S.Context .getTargetInfo ().hasFeature (" sve" ) ||
8092
8092
S.Context .getTargetInfo ().hasFeature (" sme" ) ||
8093
- IsTargetCUDAAndHostARM ) &&
8093
+ IsTargetDeviceAndHostARM ) &&
8094
8094
VecKind == VectorKind::Neon) {
8095
8095
S.Diag (Attr.getLoc (), diag::err_attribute_unsupported)
8096
8096
<< Attr << " 'neon', 'mve', 'sve' or 'sme'" ;
@@ -8099,7 +8099,7 @@ static void HandleNeonVectorTypeAttr(QualType &CurType, const ParsedAttr &Attr,
8099
8099
}
8100
8100
if (!(S.Context .getTargetInfo ().hasFeature (" neon" ) ||
8101
8101
S.Context .getTargetInfo ().hasFeature (" mve" ) ||
8102
- IsTargetCUDAAndHostARM ) &&
8102
+ IsTargetDeviceAndHostARM ) &&
8103
8103
VecKind == VectorKind::NeonPoly) {
8104
8104
S.Diag (Attr.getLoc (), diag::err_attribute_unsupported)
8105
8105
<< Attr << " 'neon' or 'mve'" ;
@@ -8121,7 +8121,7 @@ static void HandleNeonVectorTypeAttr(QualType &CurType, const ParsedAttr &Attr,
8121
8121
8122
8122
// Only certain element types are supported for Neon vectors.
8123
8123
if (!isPermittedNeonBaseType (CurType, VecKind, S) &&
8124
- !IsTargetCUDAAndHostARM ) {
8124
+ !IsTargetDeviceAndHostARM ) {
8125
8125
S.Diag (Attr.getLoc (), diag::err_attribute_invalid_vector_type) << CurType;
8126
8126
Attr.setInvalid ();
8127
8127
return ;
0 commit comments