[PATCH] D100041: [flang][OpenMP] Add semantic checks for strict nesting inside `teams` construct.

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 11 16:16:08 PDT 2021


kiranchandramohan added inline comments.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:146
+    const parser::OpenMPLoopConstruct &x) {
+  bool violation = false;
+
----------------
Nit: use braced initialization.


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:197
+
+  for (auto it{teamsBlock.begin()}; it != teamsBlock.end(); ++it) {
+    if (const auto *ompConstruct{
----------------
This way of iterating at the top-level blocks will miss cases where there is a construct (for e.g do loop) which has further blocks inside. See a test below,


```
  !$omp teams
  do i = 1, N
  !$omp task
    do k = 1, N
     a = 3.14
  enddo
  !$omp end task
  enddo
  !$omp end teams
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100041



More information about the llvm-commits mailing list