[PATCH] D93091: [Flang] [OpenMP] Add semantic checks for OpenMP Workshare Construct

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 15:36:07 PST 2020


kiranchandramohan added inline comments.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:766
+              context_.Say(expr.source,
+                  "User defined non-ELEMENTAL function "
+                  "'%s' is not allowed in a WORKSHARE construct"_err_en_US,
----------------
I think use of non-elemental function can be outside an assignment statement like in the where statement below.
```
program mn
  integer :: a(10) = (/1,2,3,4,5,6,7,8,9,10/)
  !$omp workshare
  where ( a .lt. f()) a = a + 5
  !$omp end workshare
contains
  integer function f()
    f = 5
  end function
end program
```


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:790-793
+        context_.Say(source,
+            "OpenMP '%s' construct is not allowed "
+            "in a WORKSHARE construct"_err_en_US,
+            parser::ToUpperCaseLetters(getDirectiveName(beginDir.v).str()));
----------------
Is it better to use OmpStructureChecker::HasInvalidWorksharingNesting for handling this?


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

https://reviews.llvm.org/D93091



More information about the llvm-commits mailing list