[flang-commits] [flang] [llvm] [Flang][OpenMP][WIP] Initial OpenMP 6.1 Polymorpic Mapping Implementation (PR #228747)

Michael Klemm via flang-commits flang-commits at lists.llvm.org
Wed Oct 14 22:50:10 PDT 2026


================
@@ -833,6 +812,96 @@ bool OmpStructureChecker::InTargetRegion() {
   return false;
 }
 
+void OmpStructureChecker::CheckPolymorphicMapObjects(
+    const parser::OmpObjectList &objects) {
+  if (context_.langOptions().getOpenMPVersion() >= 61)
+    return;
+
+  llvm::SmallPtrSet<const Symbol *, 8> diagnosed;
+  for (const parser::OmpObject &object : objects.v) {
+    llvm::SmallVector<const Symbol *, 2> candidates;
+    if (const Symbol * symbol{GetObjectSymbol(object, /*ultimate=*/true)})
+      candidates.push_back(symbol);
+    if (const Symbol * symbol{GetBaseObjectSymbol(object)})
+      candidates.push_back(symbol);
----------------
mjklemm wrote:

That case should be fine from an OpenMP perspective.  The main issue with polymorphic types is not mapping individual components but making sure that enough memory is allocated to contain the real dynamic type of the object to be mapped.  That a new thing with OpenMP 6.1.

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


More information about the flang-commits mailing list