rGa59665930b87 introduced a different algorithm to check context nesting. With each nested context, we push an entry in the dirContext_ vector. Therefore intuitively, a the current context should be considered nested when the size of the vector is at least 2 e.g.
!$ omp do --> context pushed in vector, size 1 !$omp single --> context pushed in vector, size 2
With the change introduced in rGa59665930b87 , 4 test cases were failing. Those tests were to do with nesting checking, BUT the nesting check was being done BEFORE pushing the current context into the vector. That was counterintuitive.
This patch fixes the code (that was causing test failure) and uses the more intuitive structure of ALWAYS pushing the context first while visiting a construct, and then implement checks that are dependent on nesting check.
Also introduces helper functions for getting the parent context and checking whether a clause is present in the parent context.
These helper functions help in the implementation of more sema checks that requires getting information about the parent context.
Nit: Are both checks necessary, given that the second includes the first?