[PATCH] D65835: [OpenMP] Permit map with DSA on combined directive

Joel E. Denny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 21 13:09:03 PDT 2019


jdenny marked an inline comment as done.
jdenny added inline comments.


================
Comment at: clang/lib/Sema/Sema.cpp:2108
 void Sema::PushCapturedRegionScope(Scope *S, CapturedDecl *CD, RecordDecl *RD,
                                    CapturedRegionKind K) {
+  CapturedRegionScopeInfo *CSI = new CapturedRegionScopeInfo(
----------------
ABataev wrote:
> I would suggest adding a new parameter for CapturedLevel and the same parameter to `ActOnCapturedRegionStart` function. And pass the value for `CapturedLevel` explicitly at `ActOnCapturedRegionStart` function call in SemaOpenMP.cpp rather than rely on this solution.
> Also, for each separate OpenMP directive, this counter must start from `0`. Currently, I think, it may lead to crash if we have several directives. Something like:
> ```
> #pragma omp parallel
> #pragma omp target teams
> ...
> ```
> I think it will work incorrectly for this example.
I think the check that `OpenMPLevel` is the same prevents the problem you mention.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65835/new/

https://reviews.llvm.org/D65835





More information about the cfe-commits mailing list