[clang] [NFC][Clang][OpenMP] Refactor mapinfo generation for captured vars (PR #146891)

Abhinav Gaba via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 3 07:01:07 PDT 2025


================
@@ -8826,6 +8830,51 @@ class MappableExprsHandler {
       return (HasPresent && !HasPresentR) || (HasAllocs && !HasAllocsR);
     });
 
+    auto GenerateInfoForComponentLists =
+        [&](ArrayRef<MapData> DeclComponentLists,
+            bool IsEligibleForTargetParamFlag) {
+          MapCombinedInfoTy CurInfoForComponentLists;
+          StructRangeInfoTy PartialStruct;
----------------
abhinavgaba wrote:

Moving PartialStruct here allows us to make it local to each set of DeclComponentLists, so when GenerateInfoForComponentLists is called multiple times with different lists, we'll get different combined entries and member-of flags for each of those lists.

For now, this is called only once with the full set of DeclComponentLists from line 8867.

https://github.com/llvm/llvm-project/pull/146891


More information about the cfe-commits mailing list