[flang][OpenMP] Add semantic checks for occurrence of nested Barrier regions
authorArnamoy Bhattacharyya <arnamoy.bhattacharyya@huawei.com>
Fri, 18 Jun 2021 19:37:36 +0000 (15:37 -0400)
committerArnamoy Bhattacharyya <arnamoy.bhattacharyya@huawei.com>
Fri, 18 Jun 2021 20:24:36 +0000 (16:24 -0400)
commit8fdd475c85634c4a5e5cd83d7dc15ff56c458813
tree9b10dc7f017216b853ce92b4cf63c9c191ca76f8
parentdd15c2723cd29574c341ec189409a6c83fbefb04
[flang][OpenMP] Add semantic checks for occurrence of nested Barrier regions

This patch adds the following nesting check for `barrier` constructs:

```
A barrier region may not be closely nested inside a worksharing, loop, task, taskloop, critical, ordered, atomic, or master region.
```

Also adds a test case for the check,

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D99888
flang/lib/Semantics/check-omp-structure.cpp
flang/lib/Semantics/check-omp-structure.h
flang/test/Semantics/omp-nested-barrier.f90 [new file with mode: 0644]