[Flang][OpenMP][OpenACC] Fix exit out of a region in OpenMP parallel construct.
authorsameeran joshi <sameeranjayant.joshi@amd.com>
Fri, 30 Oct 2020 04:50:05 +0000 (10:20 +0530)
committerSameeran joshi <joshisameeran17@gmail.com>
Fri, 30 Oct 2020 05:33:30 +0000 (11:03 +0530)
commit61f11f807cfc359b38b9e22d005456f924464c30
treeac3068156c11554ef23eb8e3a28adfb7a6b204a9
parentedd6ed364151adf3f0eede3d6d22db1018bfd601
[Flang][OpenMP][OpenACC] Fix exit out of a region in OpenMP parallel construct.

From below mentioned standard references
OpenACC 3.0 Standards document
840 • A program may not branch into or out of an OpenACC parallel construct

OpenMP 5.0 Standards document
A program that branches into or out of a parallel region is non-conforming.

This patch
Resolves the issue of exit out of a parallel region, other branching out issues like goto statements are not handled with this patch.
Moves code from D87906 to be reused by other OpenMP/OpenACC to check-directive-structure.h.
Adds support in OpenMP parallel construct and a test case to verify.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D88655
flang/lib/Semantics/check-acc-structure.cpp
flang/lib/Semantics/check-acc-structure.h
flang/lib/Semantics/check-directive-structure.h
flang/lib/Semantics/check-omp-structure.cpp
flang/test/Semantics/omp-clause-validity01.f90