[flang-commits] [flang] [Flang][OMP]Add support for DECLARE MAPPER parsing and semantics (PR #115160)

Mats Petersson via flang-commits flang-commits at lists.llvm.org
Wed Nov 6 10:44:02 PST 2024


================
@@ -3872,6 +3872,19 @@ struct OpenMPDeclareTargetConstruct {
   std::tuple<Verbatim, OmpDeclareTargetSpecifier> t;
 };
 
+struct OmpDeclareMapperSpecifier {
+  TUPLE_CLASS_BOILERPLATE(OmpDeclareMapperSpecifier);
+  std::tuple<std::optional<Name>, TypeSpec, Name> t;
+};
+
+struct OpenMPDeclareMapperConstruct {
+  TUPLE_CLASS_BOILERPLATE(OpenMPDeclareMapperConstruct);
+  CharBlock source;
+  std::tuple<Verbatim, OmpDeclareMapperSpecifier,
+      std::list<std::list<OmpMapClause>>>
----------------
Leporacanthicus wrote:

>From what I understand, the ONLY things that can come after a `DECLARE MAPPER (...)` is a `MAP` clause, so it should be a list of map clauses. Otherwise, some other code has to check that they are genuinely map clauses and not some other thing. It would work, but I fail to see the benefit over allowing only map clauses? Feel free to explain, if there's some fundamental thing that I've missed - either that all kinds of other clauses are allowed, or that there's some useful benefit from having OmpClauseList that I've missed.

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


More information about the flang-commits mailing list