[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-06 Thread via cfe-commits

jyu2-git wrote:

Hi @vitalybuka, do you think, this patch is ready to check-in?  Thanks.

https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-06 Thread via cfe-commits

jyu2-git wrote:

Hi @vitalybuka, could you please try to see if this change fix the problem?  
Thanks.

I also put same fix in https://github.com/llvm/llvm-project/pull/91141.  But 
both test run fails, which should not cause by my change.
Thanks again.
Jennifer

https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-04 Thread via cfe-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff a8fbe500fe2ecdbd3c09ed06788092937819411f 
ebb6ac3dc1cc5f4e604ec3c7e68821432856920f -- clang/lib/Parse/ParseOpenMP.cpp 
clang/test/OpenMP/target_ast_print.cpp clang/test/OpenMP/target_map_messages.cpp
``





View the diff from clang-format here.


``diff
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 8a85e7582f..5265d8f192 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4323,7 +4323,7 @@ static OpenMPMapClauseKind isMapType(Parser ) {
   if (!Tok.isOneOf(tok::identifier, tok::kw_delete))
 return OMPC_MAP_unknown;
   Preprocessor  = P.getPreprocessor();
-  unsigned MapType = 
+  unsigned MapType =
   getOpenMPSimpleClauseType(OMPC_map, PP.getSpelling(Tok), 
P.getLangOpts());
   if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_from ||
   MapType == OMPC_MAP_tofrom || MapType == OMPC_MAP_alloc ||

``




https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-04 Thread via cfe-commits

github-actions[bot] wrote:




:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:



You can test this locally with the following command:


``bash
git-clang-format --diff a8fbe500fe2ecdbd3c09ed06788092937819411f 
ae7c7fd37eed7ff76ffddd778685450f084f3162 -- clang/lib/Parse/ParseOpenMP.cpp 
clang/test/OpenMP/target_ast_print.cpp clang/test/OpenMP/target_map_messages.cpp
``





View the diff from clang-format here.


``diff
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index bb1cbcc233..5265d8f192 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4323,8 +4323,8 @@ static OpenMPMapClauseKind isMapType(Parser ) {
   if (!Tok.isOneOf(tok::identifier, tok::kw_delete))
 return OMPC_MAP_unknown;
   Preprocessor  = P.getPreprocessor();
-  unsigned MapType = getOpenMPSimpleClauseType(
-  OMPC_map, PP.getSpelling(Tok), P.getLangOpts());
+  unsigned MapType =
+  getOpenMPSimpleClauseType(OMPC_map, PP.getSpelling(Tok), 
P.getLangOpts());
   if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_from ||
   MapType == OMPC_MAP_tofrom || MapType == OMPC_MAP_alloc ||
   MapType == OMPC_MAP_delete || MapType == OMPC_MAP_release)

``




https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread via cfe-commits

https://github.com/jyu2-git updated 
https://github.com/llvm/llvm-project/pull/90935

>From 8468a10bf34e4c432b181d40c370043ad21b5801 Mon Sep 17 00:00:00 2001
From: jyu2-git 
Date: Thu, 2 May 2024 20:55:18 -0700
Subject: [PATCH 1/4] Revert "Revert "[OpenMP][TR12] change property of
 map-type modifier." (#90885)"

This reverts commit eea81aa29848361eb5b24f24d2af643fdeb9adfd.
---
 .../clang/Basic/DiagnosticParseKinds.td   |   5 +
 clang/lib/Parse/ParseOpenMP.cpp   |  44 +++-
 clang/test/OpenMP/target_ast_print.cpp|  58 ++
 clang/test/OpenMP/target_map_messages.cpp | 105 ++
 4 files changed, 162 insertions(+), 50 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td 
b/clang/include/clang/Basic/DiagnosticParseKinds.td
index fdffb35ea0d955..44bc4e0e130de8 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -1438,6 +1438,9 @@ def err_omp_decl_in_declare_simd_variant : Error<
 def err_omp_sink_and_source_iteration_not_allowd: Error<" '%0 
%select{sink:|source:}1' must be with '%select{omp_cur_iteration - 
1|omp_cur_iteration}1'">;
 def err_omp_unknown_map_type : Error<
   "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 
'release', or 'delete'">;
+def err_omp_more_one_map_type : Error<"map type is already specified">;
+def note_previous_map_type_specified_here
+: Note<"map type '%0' is previous specified here">;
 def err_omp_unknown_map_type_modifier : Error<
   "incorrect map type modifier, expected one of: 'always', 'close', 'mapper'"
   "%select{|, 'present'|, 'present', 'iterator'}0%select{|, 'ompx_hold'}1">;
@@ -1445,6 +1448,8 @@ def err_omp_map_type_missing : Error<
   "missing map type">;
 def err_omp_map_type_modifier_missing : Error<
   "missing map type modifier">;
+def err_omp_map_modifier_specification_list : Error<
+  "empty modifier-specification-list is not allowed">;
 def err_omp_declare_simd_inbranch_notinbranch : Error<
   "unexpected '%0' clause, '%1' is specified already">;
 def err_omp_expected_clause_argument
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de7..b1cff11af590a5 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4228,13 +4228,20 @@ bool 
Parser::parseMapperModifier(SemaOpenMP::OpenMPVarListDataTy ) {
   return T.consumeClose();
 }
 
+static OpenMPMapClauseKind isMapType(Parser );
+
 /// Parse map-type-modifiers in map clause.
-/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] map-type : ] list)
+/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] [map-type] : ] list)
 /// where, map-type-modifier ::= always | close | mapper(mapper-identifier) |
 /// present
+/// where, map-type ::= alloc | delete | from | release | to | tofrom
 bool Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
+  bool HasMapType = false;
+  SourceLocation PreMapLoc = Tok.getLocation();
+  StringRef PreMapName = "";
   while (getCurToken().isNot(tok::colon)) {
 OpenMPMapModifierKind TypeModifier = isMapModifier(*this);
+OpenMPMapClauseKind MapKind = isMapType(*this);
 if (TypeModifier == OMPC_MAP_MODIFIER_always ||
 TypeModifier == OMPC_MAP_MODIFIER_close ||
 TypeModifier == OMPC_MAP_MODIFIER_present ||
@@ -4257,6 +4264,19 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 Diag(Data.MapTypeModifiersLoc.back(), diag::err_omp_missing_comma)
 << "map type modifier";
 
+} else if (getLangOpts().OpenMP >= 60 && MapKind != OMPC_MAP_unknown) {
+  if (!HasMapType) {
+HasMapType = true;
+Data.ExtraModifier = MapKind;
+MapKind = OMPC_MAP_unknown;
+PreMapLoc = Tok.getLocation();
+PreMapName = Tok.getIdentifierInfo()->getName();
+  } else {
+Diag(Tok, diag::err_omp_more_one_map_type);
+Diag(PreMapLoc, diag::note_previous_map_type_specified_here)
+<< PreMapName;
+  }
+  ConsumeToken();
 } else {
   // For the case of unknown map-type-modifier or a map-type.
   // Map-type is followed by a colon; the function returns when it
@@ -4267,8 +4287,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 continue;
   }
   // Potential map-type token as it is followed by a colon.
-  if (PP.LookAhead(0).is(tok::colon))
-return false;
+  if (PP.LookAhead(0).is(tok::colon)) {
+if (getLangOpts().OpenMP >= 60) {
+  break;
+} else {
+  return false;
+}
+  }
+
   Diag(Tok, diag::err_omp_unknown_map_type_modifier)
   << (getLangOpts().OpenMP >= 51 ? (getLangOpts().OpenMP >= 52 ? 2 : 1)
  : 0)
@@ -4278,6 +4304,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 if (getCurToken().is(tok::comma))
   

[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread via cfe-commits

https://github.com/jyu2-git updated 
https://github.com/llvm/llvm-project/pull/90935

>From 8468a10bf34e4c432b181d40c370043ad21b5801 Mon Sep 17 00:00:00 2001
From: jyu2-git 
Date: Thu, 2 May 2024 20:55:18 -0700
Subject: [PATCH 1/3] Revert "Revert "[OpenMP][TR12] change property of
 map-type modifier." (#90885)"

This reverts commit eea81aa29848361eb5b24f24d2af643fdeb9adfd.
---
 .../clang/Basic/DiagnosticParseKinds.td   |   5 +
 clang/lib/Parse/ParseOpenMP.cpp   |  44 +++-
 clang/test/OpenMP/target_ast_print.cpp|  58 ++
 clang/test/OpenMP/target_map_messages.cpp | 105 ++
 4 files changed, 162 insertions(+), 50 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td 
b/clang/include/clang/Basic/DiagnosticParseKinds.td
index fdffb35ea0d955..44bc4e0e130de8 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -1438,6 +1438,9 @@ def err_omp_decl_in_declare_simd_variant : Error<
 def err_omp_sink_and_source_iteration_not_allowd: Error<" '%0 
%select{sink:|source:}1' must be with '%select{omp_cur_iteration - 
1|omp_cur_iteration}1'">;
 def err_omp_unknown_map_type : Error<
   "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 
'release', or 'delete'">;
+def err_omp_more_one_map_type : Error<"map type is already specified">;
+def note_previous_map_type_specified_here
+: Note<"map type '%0' is previous specified here">;
 def err_omp_unknown_map_type_modifier : Error<
   "incorrect map type modifier, expected one of: 'always', 'close', 'mapper'"
   "%select{|, 'present'|, 'present', 'iterator'}0%select{|, 'ompx_hold'}1">;
@@ -1445,6 +1448,8 @@ def err_omp_map_type_missing : Error<
   "missing map type">;
 def err_omp_map_type_modifier_missing : Error<
   "missing map type modifier">;
+def err_omp_map_modifier_specification_list : Error<
+  "empty modifier-specification-list is not allowed">;
 def err_omp_declare_simd_inbranch_notinbranch : Error<
   "unexpected '%0' clause, '%1' is specified already">;
 def err_omp_expected_clause_argument
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de7..b1cff11af590a5 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4228,13 +4228,20 @@ bool 
Parser::parseMapperModifier(SemaOpenMP::OpenMPVarListDataTy ) {
   return T.consumeClose();
 }
 
+static OpenMPMapClauseKind isMapType(Parser );
+
 /// Parse map-type-modifiers in map clause.
-/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] map-type : ] list)
+/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] [map-type] : ] list)
 /// where, map-type-modifier ::= always | close | mapper(mapper-identifier) |
 /// present
+/// where, map-type ::= alloc | delete | from | release | to | tofrom
 bool Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
+  bool HasMapType = false;
+  SourceLocation PreMapLoc = Tok.getLocation();
+  StringRef PreMapName = "";
   while (getCurToken().isNot(tok::colon)) {
 OpenMPMapModifierKind TypeModifier = isMapModifier(*this);
+OpenMPMapClauseKind MapKind = isMapType(*this);
 if (TypeModifier == OMPC_MAP_MODIFIER_always ||
 TypeModifier == OMPC_MAP_MODIFIER_close ||
 TypeModifier == OMPC_MAP_MODIFIER_present ||
@@ -4257,6 +4264,19 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 Diag(Data.MapTypeModifiersLoc.back(), diag::err_omp_missing_comma)
 << "map type modifier";
 
+} else if (getLangOpts().OpenMP >= 60 && MapKind != OMPC_MAP_unknown) {
+  if (!HasMapType) {
+HasMapType = true;
+Data.ExtraModifier = MapKind;
+MapKind = OMPC_MAP_unknown;
+PreMapLoc = Tok.getLocation();
+PreMapName = Tok.getIdentifierInfo()->getName();
+  } else {
+Diag(Tok, diag::err_omp_more_one_map_type);
+Diag(PreMapLoc, diag::note_previous_map_type_specified_here)
+<< PreMapName;
+  }
+  ConsumeToken();
 } else {
   // For the case of unknown map-type-modifier or a map-type.
   // Map-type is followed by a colon; the function returns when it
@@ -4267,8 +4287,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 continue;
   }
   // Potential map-type token as it is followed by a colon.
-  if (PP.LookAhead(0).is(tok::colon))
-return false;
+  if (PP.LookAhead(0).is(tok::colon)) {
+if (getLangOpts().OpenMP >= 60) {
+  break;
+} else {
+  return false;
+}
+  }
+
   Diag(Tok, diag::err_omp_unknown_map_type_modifier)
   << (getLangOpts().OpenMP >= 51 ? (getLangOpts().OpenMP >= 52 ? 2 : 1)
  : 0)
@@ -4278,6 +4304,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 if (getCurToken().is(tok::comma))
   

[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread via cfe-commits

https://github.com/jyu2-git updated 
https://github.com/llvm/llvm-project/pull/90935

>From 8468a10bf34e4c432b181d40c370043ad21b5801 Mon Sep 17 00:00:00 2001
From: jyu2-git 
Date: Thu, 2 May 2024 20:55:18 -0700
Subject: [PATCH 1/2] Revert "Revert "[OpenMP][TR12] change property of
 map-type modifier." (#90885)"

This reverts commit eea81aa29848361eb5b24f24d2af643fdeb9adfd.
---
 .../clang/Basic/DiagnosticParseKinds.td   |   5 +
 clang/lib/Parse/ParseOpenMP.cpp   |  44 +++-
 clang/test/OpenMP/target_ast_print.cpp|  58 ++
 clang/test/OpenMP/target_map_messages.cpp | 105 ++
 4 files changed, 162 insertions(+), 50 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td 
b/clang/include/clang/Basic/DiagnosticParseKinds.td
index fdffb35ea0d955..44bc4e0e130de8 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -1438,6 +1438,9 @@ def err_omp_decl_in_declare_simd_variant : Error<
 def err_omp_sink_and_source_iteration_not_allowd: Error<" '%0 
%select{sink:|source:}1' must be with '%select{omp_cur_iteration - 
1|omp_cur_iteration}1'">;
 def err_omp_unknown_map_type : Error<
   "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 
'release', or 'delete'">;
+def err_omp_more_one_map_type : Error<"map type is already specified">;
+def note_previous_map_type_specified_here
+: Note<"map type '%0' is previous specified here">;
 def err_omp_unknown_map_type_modifier : Error<
   "incorrect map type modifier, expected one of: 'always', 'close', 'mapper'"
   "%select{|, 'present'|, 'present', 'iterator'}0%select{|, 'ompx_hold'}1">;
@@ -1445,6 +1448,8 @@ def err_omp_map_type_missing : Error<
   "missing map type">;
 def err_omp_map_type_modifier_missing : Error<
   "missing map type modifier">;
+def err_omp_map_modifier_specification_list : Error<
+  "empty modifier-specification-list is not allowed">;
 def err_omp_declare_simd_inbranch_notinbranch : Error<
   "unexpected '%0' clause, '%1' is specified already">;
 def err_omp_expected_clause_argument
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de7..b1cff11af590a5 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4228,13 +4228,20 @@ bool 
Parser::parseMapperModifier(SemaOpenMP::OpenMPVarListDataTy ) {
   return T.consumeClose();
 }
 
+static OpenMPMapClauseKind isMapType(Parser );
+
 /// Parse map-type-modifiers in map clause.
-/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] map-type : ] list)
+/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] [map-type] : ] list)
 /// where, map-type-modifier ::= always | close | mapper(mapper-identifier) |
 /// present
+/// where, map-type ::= alloc | delete | from | release | to | tofrom
 bool Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
+  bool HasMapType = false;
+  SourceLocation PreMapLoc = Tok.getLocation();
+  StringRef PreMapName = "";
   while (getCurToken().isNot(tok::colon)) {
 OpenMPMapModifierKind TypeModifier = isMapModifier(*this);
+OpenMPMapClauseKind MapKind = isMapType(*this);
 if (TypeModifier == OMPC_MAP_MODIFIER_always ||
 TypeModifier == OMPC_MAP_MODIFIER_close ||
 TypeModifier == OMPC_MAP_MODIFIER_present ||
@@ -4257,6 +4264,19 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 Diag(Data.MapTypeModifiersLoc.back(), diag::err_omp_missing_comma)
 << "map type modifier";
 
+} else if (getLangOpts().OpenMP >= 60 && MapKind != OMPC_MAP_unknown) {
+  if (!HasMapType) {
+HasMapType = true;
+Data.ExtraModifier = MapKind;
+MapKind = OMPC_MAP_unknown;
+PreMapLoc = Tok.getLocation();
+PreMapName = Tok.getIdentifierInfo()->getName();
+  } else {
+Diag(Tok, diag::err_omp_more_one_map_type);
+Diag(PreMapLoc, diag::note_previous_map_type_specified_here)
+<< PreMapName;
+  }
+  ConsumeToken();
 } else {
   // For the case of unknown map-type-modifier or a map-type.
   // Map-type is followed by a colon; the function returns when it
@@ -4267,8 +4287,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 continue;
   }
   // Potential map-type token as it is followed by a colon.
-  if (PP.LookAhead(0).is(tok::colon))
-return false;
+  if (PP.LookAhead(0).is(tok::colon)) {
+if (getLangOpts().OpenMP >= 60) {
+  break;
+} else {
+  return false;
+}
+  }
+
   Diag(Tok, diag::err_omp_unknown_map_type_modifier)
   << (getLangOpts().OpenMP >= 51 ? (getLangOpts().OpenMP >= 52 ? 2 : 1)
  : 0)
@@ -4278,6 +4304,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 if (getCurToken().is(tok::comma))
   

[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread via cfe-commits

jyu2-git wrote:

I don't really understand the problem.  So you mean 
static_cast having problem?

We have two function like this the other one is isMapModifier.  I just wonder 
why we don't have problem before.



https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread Vitaly Buka via cfe-commits

vitalybuka wrote:

Yes, its there
but it's too late

we can't cast to enum invalid values 
it should be like:
```
  unsigned MapType = getOpenMPSimpleClauseType(
  OMPC_map, PP.getSpelling(Tok), P.getLangOpts());
  if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_from ||
  MapType == OMPC_MAP_tofrom || MapType == OMPC_MAP_alloc ||
  MapType == OMPC_MAP_delete || MapType == OMPC_MAP_release)
return static_cast<>(MapType);
  return OMPC_MAP_unkno
```


https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread via cfe-commits

jyu2-git wrote:

Hi @vitalybuka, could you please check what in isMapType 
clang/lib/Parse/ParseOpenMP.cpp : 
Should look like following:
static OpenMPMapClauseKind isMapType(Parser ) {
  Token Tok = P.getCurToken();
  // The map-type token can be either an identifier or the C++ delete keyword.
  if (!Tok.isOneOf(tok::identifier, tok::kw_delete))
return OMPC_MAP_unknown;
  Preprocessor  = P.getPreprocessor();
  OpenMPMapClauseKind MapType =
  static_cast(getOpenMPSimpleClauseType(
  OMPC_map, PP.getSpelling(Tok), P.getLangOpts()));
  if (MapType == OMPC_MAP_to || MapType == OMPC_MAP_from ||
  MapType == OMPC_MAP_tofrom || MapType == OMPC_MAP_alloc ||
  MapType == OMPC_MAP_delete || MapType == OMPC_MAP_release)
return MapType;
  return OMPC_MAP_unknown;
}

https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread via cfe-commits

jyu2-git wrote:

> It fails with
> 
> ```
> diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
> index 53d89ce2fa3e..1a4442f38f6d 100644
> --- a/clang/lib/Parse/ParseOpenMP.cpp
> +++ b/clang/lib/Parse/ParseOpenMP.cpp
> @@ -4326,6 +4326,7 @@ static OpenMPMapClauseKind isMapType(Parser ) {
>OpenMPMapClauseKind MapType =
>static_cast(getOpenMPSimpleClauseType(
>OMPC_map, PP.getSpelling(Tok), P.getLangOpts()));
> +  assert((int)MapType < 6);
>return MapType;
>  }
> ```

So if I MapType is 6 and up it will assert?  Should I check 
if (MapType >= 6)
  MapType = OMPC_MAP_unknown
Thanks.



https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread Vitaly Buka via cfe-commits

vitalybuka wrote:

```
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 53d89ce2fa3e..1a4442f38f6d 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4326,6 +4326,7 @@ static OpenMPMapClauseKind isMapType(Parser ) {
   OpenMPMapClauseKind MapType =
   static_cast(getOpenMPSimpleClauseType(
   OMPC_map, PP.getSpelling(Tok), P.getLangOpts()));
+  assert((int)MapType < 6);
   return MapType;
 }
```

https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread Vitaly Buka via cfe-commits

vitalybuka wrote:

> > 7c28408
> 
> good point, maybe not, I scheduled it as with, without rebase. Let's try 
> again.

Still fails after rebase https://lab.llvm.org/buildbot/#/builders/5/builds/43115

https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread via cfe-commits

jyu2-git wrote:

> > 7c28408
> 
> good point, maybe not, I scheduled it as with, without rebase. Let's try 
> again.

Greate!  Thank you so much!!

https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread Vitaly Buka via cfe-commits

https://github.com/vitalybuka updated 
https://github.com/llvm/llvm-project/pull/90935

>From 8468a10bf34e4c432b181d40c370043ad21b5801 Mon Sep 17 00:00:00 2001
From: jyu2-git 
Date: Thu, 2 May 2024 20:55:18 -0700
Subject: [PATCH] Revert "Revert "[OpenMP][TR12] change property of map-type
 modifier." (#90885)"

This reverts commit eea81aa29848361eb5b24f24d2af643fdeb9adfd.
---
 .../clang/Basic/DiagnosticParseKinds.td   |   5 +
 clang/lib/Parse/ParseOpenMP.cpp   |  44 +++-
 clang/test/OpenMP/target_ast_print.cpp|  58 ++
 clang/test/OpenMP/target_map_messages.cpp | 105 ++
 4 files changed, 162 insertions(+), 50 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td 
b/clang/include/clang/Basic/DiagnosticParseKinds.td
index fdffb35ea0d955..44bc4e0e130de8 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -1438,6 +1438,9 @@ def err_omp_decl_in_declare_simd_variant : Error<
 def err_omp_sink_and_source_iteration_not_allowd: Error<" '%0 
%select{sink:|source:}1' must be with '%select{omp_cur_iteration - 
1|omp_cur_iteration}1'">;
 def err_omp_unknown_map_type : Error<
   "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 
'release', or 'delete'">;
+def err_omp_more_one_map_type : Error<"map type is already specified">;
+def note_previous_map_type_specified_here
+: Note<"map type '%0' is previous specified here">;
 def err_omp_unknown_map_type_modifier : Error<
   "incorrect map type modifier, expected one of: 'always', 'close', 'mapper'"
   "%select{|, 'present'|, 'present', 'iterator'}0%select{|, 'ompx_hold'}1">;
@@ -1445,6 +1448,8 @@ def err_omp_map_type_missing : Error<
   "missing map type">;
 def err_omp_map_type_modifier_missing : Error<
   "missing map type modifier">;
+def err_omp_map_modifier_specification_list : Error<
+  "empty modifier-specification-list is not allowed">;
 def err_omp_declare_simd_inbranch_notinbranch : Error<
   "unexpected '%0' clause, '%1' is specified already">;
 def err_omp_expected_clause_argument
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de7..b1cff11af590a5 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4228,13 +4228,20 @@ bool 
Parser::parseMapperModifier(SemaOpenMP::OpenMPVarListDataTy ) {
   return T.consumeClose();
 }
 
+static OpenMPMapClauseKind isMapType(Parser );
+
 /// Parse map-type-modifiers in map clause.
-/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] map-type : ] list)
+/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] [map-type] : ] list)
 /// where, map-type-modifier ::= always | close | mapper(mapper-identifier) |
 /// present
+/// where, map-type ::= alloc | delete | from | release | to | tofrom
 bool Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
+  bool HasMapType = false;
+  SourceLocation PreMapLoc = Tok.getLocation();
+  StringRef PreMapName = "";
   while (getCurToken().isNot(tok::colon)) {
 OpenMPMapModifierKind TypeModifier = isMapModifier(*this);
+OpenMPMapClauseKind MapKind = isMapType(*this);
 if (TypeModifier == OMPC_MAP_MODIFIER_always ||
 TypeModifier == OMPC_MAP_MODIFIER_close ||
 TypeModifier == OMPC_MAP_MODIFIER_present ||
@@ -4257,6 +4264,19 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 Diag(Data.MapTypeModifiersLoc.back(), diag::err_omp_missing_comma)
 << "map type modifier";
 
+} else if (getLangOpts().OpenMP >= 60 && MapKind != OMPC_MAP_unknown) {
+  if (!HasMapType) {
+HasMapType = true;
+Data.ExtraModifier = MapKind;
+MapKind = OMPC_MAP_unknown;
+PreMapLoc = Tok.getLocation();
+PreMapName = Tok.getIdentifierInfo()->getName();
+  } else {
+Diag(Tok, diag::err_omp_more_one_map_type);
+Diag(PreMapLoc, diag::note_previous_map_type_specified_here)
+<< PreMapName;
+  }
+  ConsumeToken();
 } else {
   // For the case of unknown map-type-modifier or a map-type.
   // Map-type is followed by a colon; the function returns when it
@@ -4267,8 +4287,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 continue;
   }
   // Potential map-type token as it is followed by a colon.
-  if (PP.LookAhead(0).is(tok::colon))
-return false;
+  if (PP.LookAhead(0).is(tok::colon)) {
+if (getLangOpts().OpenMP >= 60) {
+  break;
+} else {
+  return false;
+}
+  }
+
   Diag(Tok, diag::err_omp_unknown_map_type_modifier)
   << (getLangOpts().OpenMP >= 51 ? (getLangOpts().OpenMP >= 52 ? 2 : 1)
  : 0)
@@ -4278,6 +4304,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 if (getCurToken().is(tok::comma))
   

[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread Vitaly Buka via cfe-commits

vitalybuka wrote:

> 7c28408

good point, maybe not, I scheduled it as with, without rebase.
Let's try again.

https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread via cfe-commits

jyu2-git wrote:

> > Looks broken 
> > https://lab.llvm.org/buildbot/#/builders/5/builds/43104/steps/9/logs/stdio
> 
> This is special build from this PR see `git status` here 
> https://lab.llvm.org/buildbot/#/builders/5/builds/43104/steps/6/logs/stdio

Hi @vitalybuka, thanks for looking it up.  Just one more question.
Does this include my change of https://github.com/llvm/llvm-project/pull/90800, 
I checked in yesterday?
Thanks.
Jennifer

https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread Vitaly Buka via cfe-commits

vitalybuka wrote:

> Looks broken 
> https://lab.llvm.org/buildbot/#/builders/5/builds/43104/steps/9/logs/stdio

This is special build from this PR see `git status` here
https://lab.llvm.org/buildbot/#/builders/5/builds/43104/steps/6/logs/stdio

https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-03 Thread Vitaly Buka via cfe-commits

https://github.com/vitalybuka requested changes to this pull request.

Looks broken 
https://lab.llvm.org/buildbot/#/builders/5/builds/43104/steps/9/logs/stdio

https://github.com/llvm/llvm-project/pull/90935
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-02 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: None (jyu2-git)


Changes

Reland llvm/llvm-project#90499

---

Patch is 28.99 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/90935.diff


4 Files Affected:

- (modified) clang/include/clang/Basic/DiagnosticParseKinds.td (+5) 
- (modified) clang/lib/Parse/ParseOpenMP.cpp (+40-4) 
- (modified) clang/test/OpenMP/target_ast_print.cpp (+58) 
- (modified) clang/test/OpenMP/target_map_messages.cpp (+59-46) 


``diff
diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td 
b/clang/include/clang/Basic/DiagnosticParseKinds.td
index fdffb35ea0d955..44bc4e0e130de8 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -1438,6 +1438,9 @@ def err_omp_decl_in_declare_simd_variant : Error<
 def err_omp_sink_and_source_iteration_not_allowd: Error<" '%0 
%select{sink:|source:}1' must be with '%select{omp_cur_iteration - 
1|omp_cur_iteration}1'">;
 def err_omp_unknown_map_type : Error<
   "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 
'release', or 'delete'">;
+def err_omp_more_one_map_type : Error<"map type is already specified">;
+def note_previous_map_type_specified_here
+: Note<"map type '%0' is previous specified here">;
 def err_omp_unknown_map_type_modifier : Error<
   "incorrect map type modifier, expected one of: 'always', 'close', 'mapper'"
   "%select{|, 'present'|, 'present', 'iterator'}0%select{|, 'ompx_hold'}1">;
@@ -1445,6 +1448,8 @@ def err_omp_map_type_missing : Error<
   "missing map type">;
 def err_omp_map_type_modifier_missing : Error<
   "missing map type modifier">;
+def err_omp_map_modifier_specification_list : Error<
+  "empty modifier-specification-list is not allowed">;
 def err_omp_declare_simd_inbranch_notinbranch : Error<
   "unexpected '%0' clause, '%1' is specified already">;
 def err_omp_expected_clause_argument
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de7..b1cff11af590a5 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4228,13 +4228,20 @@ bool 
Parser::parseMapperModifier(SemaOpenMP::OpenMPVarListDataTy ) {
   return T.consumeClose();
 }
 
+static OpenMPMapClauseKind isMapType(Parser );
+
 /// Parse map-type-modifiers in map clause.
-/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] map-type : ] list)
+/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] [map-type] : ] list)
 /// where, map-type-modifier ::= always | close | mapper(mapper-identifier) |
 /// present
+/// where, map-type ::= alloc | delete | from | release | to | tofrom
 bool Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
+  bool HasMapType = false;
+  SourceLocation PreMapLoc = Tok.getLocation();
+  StringRef PreMapName = "";
   while (getCurToken().isNot(tok::colon)) {
 OpenMPMapModifierKind TypeModifier = isMapModifier(*this);
+OpenMPMapClauseKind MapKind = isMapType(*this);
 if (TypeModifier == OMPC_MAP_MODIFIER_always ||
 TypeModifier == OMPC_MAP_MODIFIER_close ||
 TypeModifier == OMPC_MAP_MODIFIER_present ||
@@ -4257,6 +4264,19 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 Diag(Data.MapTypeModifiersLoc.back(), diag::err_omp_missing_comma)
 << "map type modifier";
 
+} else if (getLangOpts().OpenMP >= 60 && MapKind != OMPC_MAP_unknown) {
+  if (!HasMapType) {
+HasMapType = true;
+Data.ExtraModifier = MapKind;
+MapKind = OMPC_MAP_unknown;
+PreMapLoc = Tok.getLocation();
+PreMapName = Tok.getIdentifierInfo()->getName();
+  } else {
+Diag(Tok, diag::err_omp_more_one_map_type);
+Diag(PreMapLoc, diag::note_previous_map_type_specified_here)
+<< PreMapName;
+  }
+  ConsumeToken();
 } else {
   // For the case of unknown map-type-modifier or a map-type.
   // Map-type is followed by a colon; the function returns when it
@@ -4267,8 +4287,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 continue;
   }
   // Potential map-type token as it is followed by a colon.
-  if (PP.LookAhead(0).is(tok::colon))
-return false;
+  if (PP.LookAhead(0).is(tok::colon)) {
+if (getLangOpts().OpenMP >= 60) {
+  break;
+} else {
+  return false;
+}
+  }
+
   Diag(Tok, diag::err_omp_unknown_map_type_modifier)
   << (getLangOpts().OpenMP >= 51 ? (getLangOpts().OpenMP >= 52 ? 2 : 1)
  : 0)
@@ -4278,6 +4304,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 if (getCurToken().is(tok::comma))
   ConsumeToken();
   }
+  if (getLangOpts().OpenMP >= 60 && !HasMapType) {
+if (!Tok.is(tok::colon)) {
+  Diag(Tok, diag::err_omp_unknown_map_type);
+  

[clang] Reland "[OpenMP][TR12] change property of map-type modifier." (PR #90935)

2024-05-02 Thread via cfe-commits

https://github.com/jyu2-git created 
https://github.com/llvm/llvm-project/pull/90935

Reland llvm/llvm-project#90499

>From 7c28408e39f83dd44a59caf7b8539e7920504277 Mon Sep 17 00:00:00 2001
From: jyu2-git 
Date: Thu, 2 May 2024 20:55:18 -0700
Subject: [PATCH] Revert "Revert "[OpenMP][TR12] change property of map-type
 modifier." (#90885)"

This reverts commit eea81aa29848361eb5b24f24d2af643fdeb9adfd.
---
 .../clang/Basic/DiagnosticParseKinds.td   |   5 +
 clang/lib/Parse/ParseOpenMP.cpp   |  44 +++-
 clang/test/OpenMP/target_ast_print.cpp|  58 ++
 clang/test/OpenMP/target_map_messages.cpp | 105 ++
 4 files changed, 162 insertions(+), 50 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td 
b/clang/include/clang/Basic/DiagnosticParseKinds.td
index fdffb35ea0d955..44bc4e0e130de8 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -1438,6 +1438,9 @@ def err_omp_decl_in_declare_simd_variant : Error<
 def err_omp_sink_and_source_iteration_not_allowd: Error<" '%0 
%select{sink:|source:}1' must be with '%select{omp_cur_iteration - 
1|omp_cur_iteration}1'">;
 def err_omp_unknown_map_type : Error<
   "incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 
'release', or 'delete'">;
+def err_omp_more_one_map_type : Error<"map type is already specified">;
+def note_previous_map_type_specified_here
+: Note<"map type '%0' is previous specified here">;
 def err_omp_unknown_map_type_modifier : Error<
   "incorrect map type modifier, expected one of: 'always', 'close', 'mapper'"
   "%select{|, 'present'|, 'present', 'iterator'}0%select{|, 'ompx_hold'}1">;
@@ -1445,6 +1448,8 @@ def err_omp_map_type_missing : Error<
   "missing map type">;
 def err_omp_map_type_modifier_missing : Error<
   "missing map type modifier">;
+def err_omp_map_modifier_specification_list : Error<
+  "empty modifier-specification-list is not allowed">;
 def err_omp_declare_simd_inbranch_notinbranch : Error<
   "unexpected '%0' clause, '%1' is specified already">;
 def err_omp_expected_clause_argument
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 18ba1185ee8de7..b1cff11af590a5 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4228,13 +4228,20 @@ bool 
Parser::parseMapperModifier(SemaOpenMP::OpenMPVarListDataTy ) {
   return T.consumeClose();
 }
 
+static OpenMPMapClauseKind isMapType(Parser );
+
 /// Parse map-type-modifiers in map clause.
-/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] map-type : ] list)
+/// map([ [map-type-modifier[,] [map-type-modifier[,] ...] [map-type] : ] list)
 /// where, map-type-modifier ::= always | close | mapper(mapper-identifier) |
 /// present
+/// where, map-type ::= alloc | delete | from | release | to | tofrom
 bool Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
+  bool HasMapType = false;
+  SourceLocation PreMapLoc = Tok.getLocation();
+  StringRef PreMapName = "";
   while (getCurToken().isNot(tok::colon)) {
 OpenMPMapModifierKind TypeModifier = isMapModifier(*this);
+OpenMPMapClauseKind MapKind = isMapType(*this);
 if (TypeModifier == OMPC_MAP_MODIFIER_always ||
 TypeModifier == OMPC_MAP_MODIFIER_close ||
 TypeModifier == OMPC_MAP_MODIFIER_present ||
@@ -4257,6 +4264,19 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 Diag(Data.MapTypeModifiersLoc.back(), diag::err_omp_missing_comma)
 << "map type modifier";
 
+} else if (getLangOpts().OpenMP >= 60 && MapKind != OMPC_MAP_unknown) {
+  if (!HasMapType) {
+HasMapType = true;
+Data.ExtraModifier = MapKind;
+MapKind = OMPC_MAP_unknown;
+PreMapLoc = Tok.getLocation();
+PreMapName = Tok.getIdentifierInfo()->getName();
+  } else {
+Diag(Tok, diag::err_omp_more_one_map_type);
+Diag(PreMapLoc, diag::note_previous_map_type_specified_here)
+<< PreMapName;
+  }
+  ConsumeToken();
 } else {
   // For the case of unknown map-type-modifier or a map-type.
   // Map-type is followed by a colon; the function returns when it
@@ -4267,8 +4287,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 continue;
   }
   // Potential map-type token as it is followed by a colon.
-  if (PP.LookAhead(0).is(tok::colon))
-return false;
+  if (PP.LookAhead(0).is(tok::colon)) {
+if (getLangOpts().OpenMP >= 60) {
+  break;
+} else {
+  return false;
+}
+  }
+
   Diag(Tok, diag::err_omp_unknown_map_type_modifier)
   << (getLangOpts().OpenMP >= 51 ? (getLangOpts().OpenMP >= 52 ? 2 : 1)
  : 0)
@@ -4278,6 +4304,14 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy ) {
 if