================
@@ -1906,8 +2036,22 @@ bool ClauseProcessor::processMap(
 
         for (const Fortran::parser::OmpObject &ompObject :
              std::get<Fortran::parser::OmpObjectList>(mapClause->v.t).v) {
+          llvm::omp::OpenMPOffloadMappingFlags objectsMapTypeBits = 
mapTypeBits;
+          checkAndApplyDeclTargetMapFlags(converter, objectsMapTypeBits,
+                                          getOmpObjectSymbol(ompObject));
+
           llvm::SmallVector<mlir::Value> bounds;
           std::stringstream asFortran;
+          const Fortran::semantics::Symbol *parentSym = nullptr;
+
+          if (getOmpObjectSymbol(ompObject)->owner().IsDerivedType()) {
+            memberPlacementIndices.push_back(
+                firOpBuilder.getI64IntegerAttr(findComponenetMemberPlacement(
+                    getOmpObjectSymbol(ompObject)->owner().symbol(),
----------------
agozillon wrote:

Not a dumb question at all (no question is imo!), and someone else may be able 
to shine further light on it if my assumptions are wrong (still learning my 
away around the derived types myself).

I believe the way `getOmpObjParentSymbol `is currently set up so that it will 
retrieve the first symbol in the list (as it uses `getLastName`), e.g. if we 
had some kind of nested derived type mapping like below:

`map(to: dtype1%dtype2%scalar)`

>From my understanding we'd get `dtype1`, in the case of 
>`getOmpObjectSymbol(ompObject)->owner().symbol()`, we would get `dtype2`, the 
>difference between one up and the first effectively! And in the above case we 
>would like to get the index of the member in its direct parent I believe. 

However, for the currently covered set of cases by this PR using either should 
result in the same result I believe, so perhaps I was getting a little ahead of 
myself with this line!

https://github.com/llvm/llvm-project/pull/81511
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to