[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
Thu Jun 30 09:04:37 PDT 2022


jyu2 added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:17480
     DeclRefExpr *Ref = nullptr;
-    if (!VD && !CurContext->isDependentContext())
-      Ref = buildCapture(*this, D, SimpleRefExpr, /*WithInit=*/false);
-    DSAStack->addDSA(D, RefExpr->IgnoreParens(), OMPC_private, Ref);
+    if (!VD && !CurContext->isDependentContext()) {
+      auto *FD = dyn_cast<FieldDecl>(D);
----------------
jyu2 wrote:
> ABataev wrote:
> > A check here not for curcontext dependent but for FD being dependent?
> I can not this to work.  Since the private copy only build under only build non-dependent context. 
> 
> 
fix typo:
I can not get this to work, since the private copy only build under non-dependent context.


================
Comment at: clang/lib/Sema/TreeTransform.h:122
+  /// the RebuildME uses to set if member expression needs to be rebuilt.
+  bool RebuildME = false;
+
----------------
ABataev wrote:
> I think we don't need to add a new field here. Can instead we have a check for regions with default clauses, if possible?
It seems during the TransformMemberExpr, I can not get Directives info for omp regions to check.  Could you give me hand? 
Thanks.  



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

https://reviews.llvm.org/D127803



More information about the cfe-commits mailing list