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

Akash Banerjee via flang-commits flang-commits at lists.llvm.org
Wed Nov 6 11:19:55 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>>>
----------------
TIFitis wrote:

We already have an OpenMP semantic checker in place to allow/disallow clauses. All OpenMP directives use the OMPClauseList to accept OpenMP clauses.

The llvm/include/llvm/Frontend/OpenMP/OMP.td file dictates which clauses are allowed etc. I believe for Declare Mapper we should only have map clause as a Required Clause.


This is the standard away of parsing clauses for OpenMP directives and all other directives I believe follow this.

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


More information about the flang-commits mailing list