@@ -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
@@ -4323,12 +4289,13 @@ static OpenMPMapClauseKind isMapType(Parser &P) {
4323
4289
if (!Tok.isOneOf (tok::identifier, tok::kw_delete))
4324
4290
return OMPC_MAP_unknown;
4325
4291
Preprocessor &PP = P.getPreprocessor ();
4326
- unsigned MapType =
4327
- getOpenMPSimpleClauseType (OMPC_map, PP.getSpelling (Tok), P.getLangOpts ());
4292
+ OpenMPMapClauseKind MapType =
4293
+ static_cast <OpenMPMapClauseKind>(getOpenMPSimpleClauseType (
4294
+ OMPC_map, PP.getSpelling (Tok), P.getLangOpts ()));
4328
4295
if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_from ||
4329
4296
MapType == OMPC_MAP_tofrom || MapType == OMPC_MAP_alloc ||
4330
4297
MapType == OMPC_MAP_delete || MapType == OMPC_MAP_release)
4331
- return static_cast <OpenMPMapClauseKind>( MapType) ;
4298
+ return MapType;
4332
4299
return OMPC_MAP_unknown;
4333
4300
}
4334
4301
@@ -4712,10 +4679,8 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind DKind,
4712
4679
// Only parse map-type-modifier[s] and map-type if a colon is present in
4713
4680
// the map clause.
4714
4681
if (ColonPresent) {
4715
- if (getLangOpts ().OpenMP >= 60 && getCurToken ().is (tok::colon))
4716
- Diag (Tok, diag::err_omp_map_modifier_specification_list);
4717
4682
IsInvalidMapperModifier = parseMapTypeModifiers (Data);
4718
- if (getLangOpts (). OpenMP < 60 && !IsInvalidMapperModifier)
4683
+ if (!IsInvalidMapperModifier)
4719
4684
parseMapType (*this , Data);
4720
4685
else
4721
4686
SkipUntil (tok::colon, tok::annot_pragma_openmp_end, StopBeforeMatch);
0 commit comments