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

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 24 06:35:29 PDT 2022


ABataev added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:2398
+        return VD;
+      ExprResult ThisExpr = ActOnCXXThis(SourceLocation());
+      if (ThisExpr.isInvalid())
----------------
Maybe `BuildCXXThisExpr(SourceLocation(), getCurrentThisType(), /*IsImplicit=*/true)`?


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:2410
+          buildCaptureDecl(*this, FD->getIdentifier(), ME,
+                           DVarPrivate.CKind == OMPC_private ? false : true,
+                           CurContext->getParent(),
----------------
Just `DVarPrivate.CKind != OMPC_private`


================
Comment at: clang/lib/Sema/TreeTransform.h:11071-11073
+  if (!getDerived().AlwaysRebuild() && !getSema().getLangOpts().OpenMP &&
+      Base.get() == E->getBase() && QualifierLoc == E->getQualifierLoc() &&
+      Member == E->getMemberDecl() && FoundDecl == E->getFoundDecl() &&
----------------
Why do we need this check here?


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

https://reviews.llvm.org/D127803



More information about the cfe-commits mailing list