[PATCH] D127803: Generate the capture for field when the field is used with implicit default.

Jennifer Yu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 14 15:06:11 PDT 2022


jyu2 created this revision.
jyu2 added reviewers: ABataev, jdoerfert, mikerice.
jyu2 added projects: OpenMP, clang.
Herald added a project: All.
jyu2 requested review of this revision.
Herald added a subscriber: sstefan1.

This is to fix assert when field is referenced and default clause is used.
The problem of assert is the capture is not generated for the field.
This patch is to generate capture when the field is used with implicit default, use it in the code, and save the capture off to make sure it is considered from that point and add first/private clauses.
1>Add new sema function isOpenMPFDCaptureDecl, the isOpenMPCaptureDecl is called before return.  The capture reference is

  generated and saved in DSA.  It is called in BuildFieldReferenceExpr.

2>Add new function insertDSA to save newly generated Capture info for FD.
3>Add addition argument in hasDSA to check default attribute for default(first|private).
4>Add new field ImplicitFD in DSAVarData used in VisitDeclRefExpr and when building the clause.
5>Change isOpenMPPrivateDecl where stop propagate the capture from the enclosing region for private variable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127803

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/Sema/SemaExprMember.cpp
  clang/lib/Sema/SemaOpenMP.cpp
  clang/lib/Sema/TreeTransform.h
  clang/test/OpenMP/default_firstprivate_ast_print.cpp
  clang/test/OpenMP/default_private_ast_print.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127803.436956.patch
Type: text/x-patch
Size: 22942 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220614/0e1244f1/attachment-0001.bin>


More information about the cfe-commits mailing list