[PATCH] D100228: [flang][OpenMP] Add semantic check for close nesting of `master` regions

Arnamoy B via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 13 12:32:48 PDT 2021


arnamoy10 added inline comments.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:371
     CheckIfDoOrderedClause(beginDir);
+    CheckMasterNesting(x);
+  }
----------------
kiranchandramohan wrote:
> Nit: Can we check whether it is the master construct before calling the check function?
Done, thanks!


================
Comment at: flang/lib/Semantics/check-omp-structure.h:80
+static OmpDirectiveSet nestedMasterErrSet{
+    OmpDirectiveSet{Directive::OMPD_atomic} | taskGeneratingSet | parallelSet |
+    doSet};
----------------
kiranchandramohan wrote:
> Why is parallelSet here? Master is allowed inside parallel.
Good catch, updated the code and removed it.  Now the set is inspired from [[ https://github.com/llvm/llvm-project/blob/c058a7122787c8e503cf6306b8da03c0e56a41a5/flang/lib/Semantics/check-omp-structure.cpp#L215| here ]]


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100228/new/

https://reviews.llvm.org/D100228



More information about the llvm-commits mailing list