[flang-commits] [flang] [MLIR][OpenMP] Add Lowering support for implicitly linking to default declare mappers (PR #131006)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Mon Mar 17 09:34:46 PDT 2025


================
@@ -1023,7 +1041,7 @@ bool ClauseProcessor::processMap(
     const auto &[mapType, typeMods, mappers, iterator, objects] = clause.t;
     llvm::omp::OpenMPOffloadMappingFlags mapTypeBits =
         llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_NONE;
-    std::string mapperIdName;
+    std::string mapperIdName = "implicit";
----------------
skatrak wrote:

The "default" mapper identifier is explicitly mentioned to be named as such by the spec, and users can define declare mappers with that name to trigger their special behavior, so I think that one should be implemented as it currently is. However, it seems like this one is an internal compiler marker, but it has a user-friendly name. My worry is that someone could just do this and inadvertently trigger some unexpected handling:
```f90
!$omp declare mapper(implicit : my_type :: my_var) map(...)
```
We should probably use some obfuscated name instead, like "__implicit_mapper" or something. Maybe there are some guidelines in the OpenMP spec or the LLVM project for naming reserved internal variables like this.

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


More information about the flang-commits mailing list