[flang-commits] [flang] [Flang][OpenMP][MLIR] Add attach and ref map type lowering to MLIR (PR #177301)

via flang-commits flang-commits at lists.llvm.org
Tue Mar 3 14:47:15 PST 2026


================
@@ -1507,6 +1506,34 @@ bool ClauseProcessor::processMap(
         mapTypeBits |= mlir::omp::ClauseMapFlags::ompx_hold;
     }
 
+    if (refMod) {
+      switch (*refMod) {
+      case Map::RefModifier::RefPtee:
+        mapTypeBits |= mlir::omp::ClauseMapFlags::ref_ptee;
+        break;
+      case Map::RefModifier::RefPtr:
+        mapTypeBits |= mlir::omp::ClauseMapFlags::ref_ptr;
+        break;
+      case Map::RefModifier::RefPtrPtee:
+        mapTypeBits |= mlir::omp::ClauseMapFlags::ref_ptr_ptee;
+        break;
+      }
+    }
+
+    if (attachMod) {
+      switch (*attachMod) {
+      case Map::AttachModifier::Always:
+        mapTypeBits |= mlir::omp::ClauseMapFlags::attach_always;
+        break;
+      case Map::AttachModifier::Never:
+        mapTypeBits |= mlir::omp::ClauseMapFlags::attach_never;
+        break;
+      case Map::AttachModifier::Auto:
+        mapTypeBits |= mlir::omp::ClauseMapFlags::attach_auto;
+        break;
+      }
----------------
agozillon wrote:

We don't currently do that with the other map cases, and I think but I'm not 100% sure (as it's been a while) that sticking a default case in if we cover everything tends to flag up with werror in one of the buildbots. So, I'd prefer to avoid the addition, but happy to add it if you still want to, at least I'll be able to to find out if I'm misremembering about the buildbot! :-)

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


More information about the flang-commits mailing list