[PATCH] D30135: [OpenMP] Generate better diagnostics for cancel and cancellation point

Jonas Hahnfeld via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 20 01:32:20 PST 2017


Hahnfeld added a comment.

In https://reviews.llvm.org/D30135#681354, @ABataev wrote:

> Not sure that this is better because at first, we need to be sure that this nesting is allowed. Why do we need to perform some additional analysis if nesting is not allowed at all?


`CheckNestingOfRegions` uses `CancelRegion` to determine whether cancel and cancellation point may be nested inside the parent construct. However with the current code, `CancelRegion` would only be checked afterwards.

  #pragma omp parallel
    {
  #pragma omp cancellation point unknown
    }

therefore produces `region cannot be closely nested inside 'parallel' region`. After this change, it says `one of 'for', 'parallel', 'sections' or 'taskgroup' is expected` as in the test case which is better IMO.

Should I try to improve the summary to explain that?


https://reviews.llvm.org/D30135





More information about the cfe-commits mailing list