[flang][openmp] Add General Semantic Checks for Allocate Directive
authorIrina Dobrescu <irina.dobrescu@arm.com>
Thu, 22 Apr 2021 15:45:19 +0000 (15:45 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Thu, 22 Apr 2021 16:15:06 +0000 (16:15 +0000)
commit123ae425669e3e06f173958cc686ef6f81e498a8
tree57689045e54818720b4f94f67387022a54b9698e
parent11232037cc4aee4fed186e50beae4a486c729d62
[flang][openmp] Add General Semantic Checks for Allocate Directive

This patch adds semantic checks for the General Restrictions of the
Allocate Directive.

Since the requires directive is not yet implemented in Flang, the
restriction:
```
allocate directives that appear in a target region must
specify an allocator clause unless a requires directive with the
dynamic_allocators clause is present in the same compilation unit
```
will need to be updated at a later time.

A different patch will be made with the Fortran specific restrictions of
this directive.

I have used the code from https://reviews.llvm.org/D89395 for the
CheckObjectListStructure function.

Co-authored-by: Isaac Perry <isaac.perry@arm.com>
Reviewed By: clementval, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D91159
19 files changed:
flang/include/flang/Parser/parse-tree.h
flang/include/flang/Semantics/symbol.h
flang/lib/Semantics/check-omp-structure.cpp
flang/lib/Semantics/check-omp-structure.h
flang/lib/Semantics/resolve-directives.cpp
flang/test/Semantics/omp-allocate01.f90 [new file with mode: 0644]
flang/test/Semantics/omp-allocate02.f90 [new file with mode: 0644]
flang/test/Semantics/omp-allocate03.f90 [new file with mode: 0644]
flang/test/Semantics/omp-allocate04.f90 [new file with mode: 0644]
flang/test/Semantics/omp-allocate05.f90 [new file with mode: 0644]
flang/test/Semantics/omp-parallel-private01.f90
flang/test/Semantics/omp-parallel-private02.f90
flang/test/Semantics/omp-parallel-private03.f90
flang/test/Semantics/omp-parallel-private04.f90
flang/test/Semantics/omp-parallel-shared01.f90
flang/test/Semantics/omp-parallel-shared02.f90
flang/test/Semantics/omp-parallel-shared03.f90
flang/test/Semantics/omp-parallel-shared04.f90
llvm/include/llvm/Frontend/OpenMP/OMP.td