[PATCH] D127803: Generate the capture for field when the field is used in openmp region with implicit default in the member function.

Jennifer Yu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 1 12:02:33 PDT 2022


jyu2 added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:2273-2274
+bool Sema::isOpenMPRebuildMemberExpr(ValueDecl *D) {
+  if (getCurCapturedRegion() &&
+      getCurCapturedRegion()->CapRegionKind == CR_OpenMP) {
+    DSAStackTy::DSAVarData DVarPrivate = DSAStack->hasDSA(
----------------
ABataev wrote:
> jyu2 wrote:
> > ABataev wrote:
> > > What if we have another outer OpenMP region, something like lambda inside OpenMP region?
> > My understanding is that hasDSA will go up to find innermost openmp region which has default clause.  Am I right here?
> Yes, if you're immediate captured region is OpenMP region. But what if you're inside lambda, which is inside OpenMP region? In this case getCurCapturedRegion()->CapRegionKind != CR_OpenMP. Will it still work, could add a test for this situation?
Good catch!!  Thank you so much!!  You are right.  I removed check for CR_OpenMP.  Just let hasDSA to find out.  And add test for this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127803



More information about the cfe-commits mailing list