[llvm-branch-commits] [Flang][OpenMP] Derived type explicit allocatable member mapping (PR #111192)

Kareem Ergawy via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Oct 8 04:21:16 PDT 2024


================
@@ -145,11 +146,174 @@ createMapInfoOp(fir::FirOpBuilder &builder, mlir::Location loc,
       builder.getIntegerAttr(builder.getIntegerType(64, false), mapType),
       builder.getAttr<mlir::omp::VariableCaptureKindAttr>(mapCaptureType),
       builder.getStringAttr(name), builder.getBoolAttr(partialMap));
-
   return op;
 }
 
-static int
+omp::ObjectList gatherObjects(omp::Object obj,
+                              semantics::SemanticsContext &semaCtx) {
+  omp::ObjectList objList;
+  std::optional<omp::Object> baseObj = obj;
+  while (baseObj.has_value()) {
+    objList.push_back(baseObj.value());
+    baseObj = getBaseObject(baseObj.value(), semaCtx);
+  }
+  return omp::ObjectList{llvm::reverse(objList)};
+}
+
+bool isDuplicateMemberMapInfo(OmpMapParentAndMemberData &parentMembers,
+                              llvm::SmallVectorImpl<int64_t> &memberIndices) {
+  for (auto memberData : parentMembers.memberPlacementIndices)
+    if (std::equal(memberIndices.begin(), memberIndices.end(),
+                   memberData.begin()))
+      return true;
+  return false;
+}
+
+static void generateArrayIndices(lower::AbstractConverter &converter,
----------------
ergawy wrote:

Please add docs with an example.

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


More information about the llvm-branch-commits mailing list