[flang-commits] [flang] [flang][OpenMP]Add parsing support for MAP(MAPPER(name) ...) (PR #116274)

Mats Petersson via flang-commits flang-commits at lists.llvm.org
Fri Nov 15 06:05:36 PST 2024


================
@@ -3718,7 +3721,8 @@ struct OmpMapClause {
   // The checks for satisfying those constraints are deferred to semantics.
   // In OpenMP 5.2 the non-comma syntax has been deprecated: keep the
   // information about separator presence to emit a diagnostic if needed.
-  std::tuple<std::optional<std::list<TypeModifier>>,
+  std::tuple<OmpMapperIdentifier, // Mapper name
----------------
Leporacanthicus wrote:

So, this was my solution to making the `maybe` work. Since we need to parse the `"MAPPER"` and then `parenthesized(name)`  and a comma. If I move the optional around, the maybe parsing doesn't work. 

Unless someone can let me know how to make something `maybe` parse to produce the wrapper thing optional.

Everything I've tried (and that's a lot - I couldn't list them all, but `std::optional<Name>` in the `std::tuple` was one of them. 

The `TypeModifier` and `IteratorModifer` and `Type` gets away with it, because they don't have a keyword with a parenthesized "argument". so they can just do a list (which is allowed to be empty). 

I did try again just now, but I can't come up with something that compiles...

https://github.com/llvm/llvm-project/pull/116274


More information about the flang-commits mailing list