[llvm-branch-commits] [flang] [Flang][OpenMP] Derived type explicit allocatable member mapping (PR #96266)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jul 2 12:02:57 PDT 2024
================
@@ -216,31 +215,50 @@ bool ClauseProcessor::processMotionClauses(lower::StatementContext &stmtCtx,
if (origSymbol && fir::isTypeWithDescriptor(origSymbol.getType()))
symAddr = origSymbol;
+ if (object.sym()->owner().IsDerivedType()) {
+ omp::ObjectList objectList = gatherObjects(object, semaCtx);
+ parentObj = objectList[0];
+ parentMemberIndices.insert({parentObj.value(), {}});
+ if (Fortran::semantics::IsAllocatableOrObjectPointer(
+ object.sym()) ||
+ memberHasAllocatableParent(object, semaCtx)) {
+ llvm::SmallVector<int> indices =
+ generateMemberPlacementIndices(object, semaCtx);
+ symAddr = createParentSymAndGenIntermediateMaps(
+ clauseLocation, converter, objectList, indices,
+ parentMemberIndices[parentObj.value()], asFortran.str(),
+ mapTypeBits);
+ }
+ }
+
----------------
agozillon wrote:
Thank you! It's intentional unfortunately. I will create a PR after this lands to align the two functions, so replication isn't required anymore. They're two seperate types of map clauses (motion clauses and regular map clauses, with motion clauses being a subset of the map clauses) that appear on different directives. When the motion clauses were added I think it was kept seperate incase it had any special considerations, but as we've been moving forward with the map work it's just been replicating the code across both.
So merging them into one is something I'd very much like to do. It might be out of the scope of this PR though. So I am happy to do it in a follow up PR once this lands!
https://github.com/llvm/llvm-project/pull/96266
More information about the llvm-branch-commits
mailing list