[flang-commits] [flang] [llvm] [Flang] Add semantic check for usage of COPYPRIVATE and NOWAIT clauses (PR #73486)

Kiran Kumar T P via flang-commits flang-commits at lists.llvm.org
Tue Nov 28 23:18:58 PST 2023


================
@@ -33,6 +33,16 @@ static OmpClauseSet privateSet{
     Clause::OMPC_private, Clause::OMPC_firstprivate, Clause::OMPC_lastprivate};
 static OmpClauseSet privateReductionSet{
     OmpClauseSet{Clause::OMPC_reduction} | privateSet};
+// omp.td cannot differentiate allowed/not allowed clause list for few
+// directives for fortran. nowait is not allowed on begin directive clause list
+// for below list of directives. Directives with conflicting list of clauses are
+// included in below list.
+static const OmpDirectiveSet noWaitClauseAllowedSet{
+    Directive::OMPD_do,
+    Directive::OMPD_do_simd,
+    Directive::OMPD_sections,
+    Directive::OMPD_single,
+};
----------------
kiranktp wrote:

> Doesn't this belong to openmp-directive-sets.h, where the other *AllowedSets are?
The usage is very much limited to check-omp-structure.[h/cpp] and do not see future usage of this definition in any other places. So thought it would be better to place it in this header file rather than in openmp-directive-sets.h file.
> Wouldn't something like noWaitClauseNotAllowedSet be a better name in this case
Thanks for the suggestion. Updated the name.

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


More information about the flang-commits mailing list