llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: None (jyu2-git)

<details>
<summary>Changes</summary>

Currently isMapType could return OpenMPMapModifierKind.

The change is to return OpenMPMapTypeKind only, if it is not MapType Kind 
OMPC_MAP_unknown is returned.

---
Full diff: https://github.com/llvm/llvm-project/pull/90800.diff


1 Files Affected:

- (modified) clang/lib/Parse/ParseOpenMP.cpp (+6-2) 


``````````diff
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 53d89ce2fa3e99..b1cff11af590a5 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -4316,7 +4316,7 @@ bool 
Parser::parseMapTypeModifiers(SemaOpenMP::OpenMPVarListDataTy &Data) {
 }
 
 /// Checks if the token is a valid map-type.
-/// FIXME: It will return an OpenMPMapModifierKind if that's what it parses.
+/// If it is not MapType kind, OMPC_MAP_unknown is returned.
 static OpenMPMapClauseKind isMapType(Parser &P) {
   Token Tok = P.getCurToken();
   // The map-type token can be either an identifier or the C++ delete keyword.
@@ -4326,7 +4326,11 @@ static OpenMPMapClauseKind isMapType(Parser &P) {
   OpenMPMapClauseKind MapType =
       static_cast<OpenMPMapClauseKind>(getOpenMPSimpleClauseType(
           OMPC_map, PP.getSpelling(Tok), P.getLangOpts()));
-  return MapType;
+  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;
 }
 
 /// Parse map-type in map clause.

``````````

</details>


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

Reply via email to