jyu2 added inline comments.
================
Comment at: clang/lib/Sema/SemaExprMember.cpp:1873-1877
+    if (auto *PrivateCopy =
+            isOpenMPFDCaptureDecl(Field, Base.get(), IsArrow, OpLoc, &SS,
+                                  /*TemplateKWLoc=*/SourceLocation(), Field,
+                                  FoundDecl, /*HadMultipleCandidates=*/false,
+                                  MemberNameInfo, MemberType, VK, OK))
----------------
ABataev wrote:
> jyu2 wrote:
> > ABataev wrote:
> > > Why do we need this function? Implicit private rule should apply (if 
> > > should) only to this-Юашдув kind of expressions, if something like 
> > > parent.field expression is used, parent should be private, not 
> > > private.field. Or I'm missing something?
> > You are right for "parent.a" only privatize "parent".
> > 
> > But if 'a' is a field access in a member function then 'a' is privatized, 
> > not "this".  It is same with firstprivate(a).  But for the explicit 
> > firstprivate(a), the capture is build in ActOnOpenMPFirstprivateClause, so 
> > it can be mapped to reference in the omp region.  For Implicit, I need to 
> > build capture for the first reference in the omp region with 
> > defalut(first|private) is used.  And used that to generate firstprivate 
> > clause at end when the call to ActOnOpenMPFirstprivateClause when 
> > generating implicit clause.
> > 
> > Is this reasonable?
> But you don't need all this info to build the capture. I think you can reuse 
> existing isOpenMPCapturedDecl function without adding this extra 
> isOpenMPFDCaptureDecl. Most probably, you don't need Base and all other stuff 
> to build this->fd member expression.
Okay, I moved my code into isOpenMPCapturedDecl.


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

https://reviews.llvm.org/D127803

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to