This patch adds a function to help Semantic checks that deal with "closely nesting" condition check.
Also modifies the closely nesting semantic check code for worksharing regions. Previously the check was checking only the immediate parent. e.g
!$omp do !omp target !$omp do
In the previous code, though the inside do is closely nested inside the outside do (no parallel in between), the existing check would not catch the violation, as the immediate parent of the nested do is target.
With the new function, this condition will be caught.
More test cases are added to check more scenarios.
Can you change the name to IsCloselyNestedRegion.
Note that the definition of closely nested construct is different. A construct nested inside another construct with no other construct nested between them.