[llvm-branch-commits] [flang] [MLIR][OpenMP] Add Lowering support for OpenMP custom mappers in map clause (PR #121001)
Sergio Afonso via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Feb 7 07:57:53 PST 2025
================
@@ -970,6 +972,20 @@ void ClauseProcessor::processMapObjects(
}
}
+ if (!mapperIdName.empty()) {
+ if (mapperIdName == "default") {
+ auto &typeSpec = object.sym()->owner().IsDerivedType()
+ ? *object.sym()->owner().derivedTypeSpec()
+ : object.sym()->GetType()->derivedTypeSpec();
+ mapperIdName = typeSpec.name().ToString() + ".default";
+ mapperIdName = converter.mangleName(mapperIdName, *typeSpec.GetScope());
+ }
+ assert(converter.getMLIRSymbolTable()->lookup(mapperIdName) &&
+ "mapper not found");
+ mapperId = mlir::FlatSymbolRefAttr::get(&converter.getMLIRContext(),
+ mapperIdName);
+ mapperIdName.clear();
----------------
skatrak wrote:
Related to the suggestion to pass `mapperIdName` as an `llvm::StringRef`, this wouldn't be needed if the `std::string` used to build the `mapperId` symbol was local to this code block.
https://github.com/llvm/llvm-project/pull/121001
More information about the llvm-branch-commits
mailing list