[flang-commits] [flang] [llvm] [mlir] [flang][mlir][OpenMP] Support iterator modifier in declare mapper map clause (PR #215485)
via flang-commits
flang-commits at lists.llvm.org
Wed Sep 23 13:56:52 PDT 2026
================
@@ -2046,13 +2046,125 @@ bool ClauseProcessor::processMap(
}
}
- if (iterator)
- TODO(currentLocation,
- "Support for iterator modifiers is not implemented yet");
TodoLocators(currentLocation, objects);
- processMapObjects(stmtCtx, clauseLocation,
- std::get<omp::ObjectList>(clause.t), mapTypeBits,
+ llvm::SmallVector<IteratorRange> iteratorRanges;
+ llvm::SmallPtrSet<const Fortran::semantics::Symbol *, 4> ivSyms;
+ collectIteratorIVs(clause, converter, stmtCtx, iteratorRanges, ivSyms);
+
+ // Objects that reference an iterator induction variable are expanded at
+ // runtime via `omp.iterator`/`map_iterated`; the rest go through the
+ // regular static map-info path below.
+ omp::ObjectList staticObjects;
+ if (!iterator) {
+ staticObjects = objects;
----------------
chichunchen wrote:
Could the existing if (!iterator) branch call processMapObjects(..., objects, ...) directly and return from the clause callback? This would avoid copying the object list for ordinary map clauses and let the iterator path continue without the surrounding else.
https://github.com/llvm/llvm-project/pull/215485
More information about the flang-commits
mailing list