@@ -8336,12 +8336,11 @@ static bool verifyValidIntegerConstantExpr(Sema &S, const ParsedAttr &Attr,
83368336// / match one of the standard Neon vector types.
83378337static void HandleNeonVectorTypeAttr (QualType &CurType, const ParsedAttr &Attr,
83388338 Sema &S, VectorKind VecKind) {
8339- bool IsTargetCUDAAndHostARM = false ;
8340- if (S.getLangOpts ().CUDAIsDevice ) {
8341- const TargetInfo *AuxTI = S.getASTContext ().getAuxTargetInfo ();
8342- IsTargetCUDAAndHostARM =
8343- AuxTI && (AuxTI->getTriple ().isAArch64 () || AuxTI->getTriple ().isARM ());
8344- }
8339+ const TargetInfo *AuxTI = S.getASTContext ().getAuxTargetInfo ();
8340+ bool IsArm = AuxTI->getTriple ().isAArch64 () || AuxTI->getTriple ().isARM ();
8341+
8342+ bool IsTargetCUDAAndHostARM = IsArm && S.getLangOpts ().CUDAIsDevice ;
8343+ bool IsTargetOpenMPDeviceAndHostARM = IsArm && S.getLangOpts ().OpenMPIsTargetDevice ;
83458344
83468345 // Target must have NEON (or MVE, whose vectors are similar enough
83478346 // not to need a separate attribute)
@@ -8376,7 +8375,7 @@ static void HandleNeonVectorTypeAttr(QualType &CurType, const ParsedAttr &Attr,
83768375
83778376 // Only certain element types are supported for Neon vectors.
83788377 if (!isPermittedNeonBaseType (CurType, VecKind, S) &&
8379- !IsTargetCUDAAndHostARM) {
8378+ !IsTargetCUDAAndHostARM && !IsTargetOpenMPDeviceAndHostARM ) {
83808379 S.Diag (Attr.getLoc (), diag::err_attribute_invalid_vector_type) << CurType;
83818380 Attr.setInvalid ();
83828381 return ;
0 commit comments