@@ -929,35 +929,18 @@ void ClauseProcessor::processMapObjects(
929
929
llvm::StringRef mapperIdNameRef) const {
930
930
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder ();
931
931
932
- auto getDefaultMapperID = [&](const omp::Object &object,
933
- std::string &mapperIdName) {
934
- if (!mlir::isa<mlir::omp::DeclareMapperOp>(
935
- firOpBuilder.getRegion ().getParentOp ())) {
936
- const semantics::DerivedTypeSpec *typeSpec = nullptr ;
937
-
938
- if (object.sym ()->owner ().IsDerivedType ())
939
- typeSpec = object.sym ()->owner ().derivedTypeSpec ();
940
- else if (object.sym ()->GetType () &&
941
- object.sym ()->GetType ()->category () ==
942
- semantics::DeclTypeSpec::TypeDerived)
943
- typeSpec = &object.sym ()->GetType ()->derivedTypeSpec ();
944
-
945
- if (typeSpec) {
946
- mapperIdName = typeSpec->name ().ToString () + " .default" ;
947
- mapperIdName =
948
- converter.mangleName (mapperIdName, *typeSpec->GetScope ());
949
- }
950
- }
951
- };
952
-
953
932
// Create the mapper symbol from its name, if specified.
954
933
mlir::FlatSymbolRefAttr mapperId;
955
- if (!mapperIdNameRef.empty () && !objects.empty () &&
956
- mapperIdNameRef != " __implicit_mapper" ) {
934
+ if (!mapperIdNameRef.empty () && !objects.empty ()) {
957
935
std::string mapperIdName = mapperIdNameRef.str ();
958
- const omp::Object &object = objects.front ();
959
- if (mapperIdNameRef == " default" )
960
- getDefaultMapperID (object, mapperIdName);
936
+ if (mapperIdName == " default" ) {
937
+ const omp::Object &object = objects.front ();
938
+ auto &typeSpec = object.sym ()->owner ().IsDerivedType ()
939
+ ? *object.sym ()->owner ().derivedTypeSpec ()
940
+ : object.sym ()->GetType ()->derivedTypeSpec ();
941
+ mapperIdName = typeSpec.name ().ToString () + " .default" ;
942
+ mapperIdName = converter.mangleName (mapperIdName, *typeSpec.GetScope ());
943
+ }
961
944
assert (converter.getModuleOp ().lookupSymbol (mapperIdName) &&
962
945
" mapper not found" );
963
946
mapperId =
@@ -995,15 +978,6 @@ void ClauseProcessor::processMapObjects(
995
978
}
996
979
}
997
980
998
- if (mapperIdNameRef == " __implicit_mapper" ) {
999
- std::string mapperIdName;
1000
- getDefaultMapperID (object, mapperIdName);
1001
- mapperId = converter.getModuleOp ().lookupSymbol (mapperIdName)
1002
- ? mlir::FlatSymbolRefAttr::get (&converter.getMLIRContext (),
1003
- mapperIdName)
1004
- : mlir::FlatSymbolRefAttr ();
1005
- }
1006
-
1007
981
// Explicit map captures are captured ByRef by default,
1008
982
// optimisation passes may alter this to ByCopy or other capture
1009
983
// types to optimise
@@ -1049,7 +1023,7 @@ bool ClauseProcessor::processMap(
1049
1023
const auto &[mapType, typeMods, mappers, iterator, objects] = clause.t ;
1050
1024
llvm::omp::OpenMPOffloadMappingFlags mapTypeBits =
1051
1025
llvm::omp::OpenMPOffloadMappingFlags::OMP_MAP_NONE;
1052
- std::string mapperIdName = " __implicit_mapper " ;
1026
+ std::string mapperIdName;
1053
1027
// If the map type is specified, then process it else Tofrom is the
1054
1028
// default.
1055
1029
Map::MapType type = mapType.value_or (Map::MapType::Tofrom);
0 commit comments