[PATCH] D92735: [Flang] [OpenMP] Add semantic checks for invalid branch into/from OpenMP constructs

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 6 14:35:41 PST 2020


kiranchandramohan requested changes to this revision.
kiranchandramohan added a comment.
This revision now requires changes to proceed.

There is a labelEnforce class (https://github.com/llvm/llvm-project/blob/a2f922140f5380571fb74179f2bf622b3b925697/flang/lib/Semantics/tools.cpp#L1338) which is used for checks in do-concurrent and co-arrays. It is used to find control flow escaping from a construct. Can that be reused?
Function CheckBranchesIntoDoBody (https://github.com/llvm/llvm-project/blob/a2f922140f5380571fb74179f2bf622b3b925697/flang/lib/Semantics/resolve-labels.cpp#L845) in resolve-labels.cpp checks for branches into the body of a loop. Can this code be reused?



================
Comment at: flang/lib/Semantics/check-omp-structure.h:76
     OmpDirectiveSet{Directive::OMPD_task} | taskloopSet};
+static OmpDirectiveSet noBranchSet{llvm::omp::Directive::OMPD_parallel,
+    llvm::omp::Directive::OMPD_single, llvm::omp::Directive::OMPD_simd,
----------------
Isn't this check true for all constructs with structured blocks like master, critical etc?


================
Comment at: flang/test/Semantics/omp-parallell01.f90:1
 ! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
 
----------------
Nit: The name of this test and the next has an extra 'l'.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92735



More information about the llvm-commits mailing list