@@ -4228,20 +4228,13 @@ bool Parser::parseMapperModifier(SemaOpenMP::OpenMPVarListDataTy &Data) {
4228
4228
return T.consumeClose ();
4229
4229
}
4230
4230
4231
- static OpenMPMapClauseKind isMapType (Parser &P);
4232
-
4233
4231
// / Parse map-type-modifiers in map clause.
4234
- // / map([ [map-type-modifier[,] [map-type-modifier[,] ...] [ map-type] : ] list)
4232
+ // / map([ [map-type-modifier[,] [map-type-modifier[,] ...] map-type : ] list)
4235
4233
// / where, map-type-modifier ::= always | close | mapper(mapper-identifier) |
4236
4234
// / present
4237
- // / where, map-type ::= alloc | delete | from | release | to | tofrom
4238
4235
bool Parser::parseMapTypeModifiers (SemaOpenMP::OpenMPVarListDataTy &Data) {
4239
- bool HasMapType = false ;
4240
- SourceLocation PreMapLoc = Tok.getLocation ();
4241
- StringRef PreMapName = " " ;
4242
4236
while (getCurToken ().isNot (tok::colon)) {
4243
4237
OpenMPMapModifierKind TypeModifier = isMapModifier (*this );
4244
- OpenMPMapClauseKind MapKind = isMapType (*this );
4245
4238
if (TypeModifier == OMPC_MAP_MODIFIER_always ||
4246
4239
TypeModifier == OMPC_MAP_MODIFIER_close ||
4247
4240
TypeModifier == OMPC_MAP_MODIFIER_present ||
@@ -4264,19 +4257,6 @@ bool Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy &Data) {
4264
4257
Diag (Data.MapTypeModifiersLoc .back (), diag::err_omp_missing_comma)
4265
4258
<< " map type modifier" ;
4266
4259
4267
- } else if (getLangOpts ().OpenMP >= 60 && MapKind != OMPC_MAP_unknown) {
4268
- if (!HasMapType) {
4269
- HasMapType = true ;
4270
- Data.ExtraModifier = MapKind;
4271
- MapKind = OMPC_MAP_unknown;
4272
- PreMapLoc = Tok.getLocation ();
4273
- PreMapName = Tok.getIdentifierInfo ()->getName ();
4274
- } else {
4275
- Diag (Tok, diag::err_omp_more_one_map_type);
4276
- Diag (PreMapLoc, diag::note_previous_map_type_specified_here)
4277
- << PreMapName;
4278
- }
4279
- ConsumeToken ();
4280
4260
} else {
4281
4261
// For the case of unknown map-type-modifier or a map-type.
4282
4262
// Map-type is followed by a colon; the function returns when it
@@ -4287,14 +4267,8 @@ bool Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy &Data) {
4287
4267
continue ;
4288
4268
}
4289
4269
// Potential map-type token as it is followed by a colon.
4290
- if (PP.LookAhead (0 ).is (tok::colon)) {
4291
- if (getLangOpts ().OpenMP >= 60 ) {
4292
- break ;
4293
- } else {
4294
- return false ;
4295
- }
4296
- }
4297
-
4270
+ if (PP.LookAhead (0 ).is (tok::colon))
4271
+ return false ;
4298
4272
Diag (Tok, diag::err_omp_unknown_map_type_modifier)
4299
4273
<< (getLangOpts ().OpenMP >= 51 ? (getLangOpts ().OpenMP >= 52 ? 2 : 1 )
4300
4274
: 0 )
@@ -4304,14 +4278,6 @@ bool Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy &Data) {
4304
4278
if (getCurToken ().is (tok::comma))
4305
4279
ConsumeToken ();
4306
4280
}
4307
- if (getLangOpts ().OpenMP >= 60 && !HasMapType) {
4308
- if (!Tok.is (tok::colon)) {
4309
- Diag (Tok, diag::err_omp_unknown_map_type);
4310
- ConsumeToken ();
4311
- } else {
4312
- Data.ExtraModifier = OMPC_MAP_unknown;
4313
- }
4314
- }
4315
4281
return false ;
4316
4282
}
4317
4283
@@ -4709,10 +4675,8 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind DKind,
4709
4675
// Only parse map-type-modifier[s] and map-type if a colon is present in
4710
4676
// the map clause.
4711
4677
if (ColonPresent) {
4712
- if (getLangOpts ().OpenMP >= 60 && getCurToken ().is (tok::colon))
4713
- Diag (Tok, diag::err_omp_map_modifier_specification_list);
4714
4678
IsInvalidMapperModifier = parseMapTypeModifiers (Data);
4715
- if (getLangOpts (). OpenMP < 60 && !IsInvalidMapperModifier)
4679
+ if (!IsInvalidMapperModifier)
4716
4680
parseMapType (*this , Data);
4717
4681
else
4718
4682
SkipUntil (tok::colon, tok::annot_pragma_openmp_end, StopBeforeMatch);
0 commit comments