@@ -981,14 +981,14 @@ static void genLoopVars(
981
981
}
982
982
983
983
static clause::Defaultmap::ImplicitBehavior
984
- getDefaultmapIfPresent (DefaultMapsTy &defaultMaps, mlir::Type varType) {
984
+ getDefaultmapIfPresent (const DefaultMapsTy &defaultMaps, mlir::Type varType) {
985
985
using DefMap = clause::Defaultmap;
986
986
987
987
if (defaultMaps.empty ())
988
988
return DefMap::ImplicitBehavior::Default;
989
989
990
990
if (llvm::is_contained (defaultMaps, DefMap::VariableCategory::All))
991
- return defaultMaps[ DefMap::VariableCategory::All] ;
991
+ return defaultMaps. at ( DefMap::VariableCategory::All) ;
992
992
993
993
// NOTE: Unsure if complex and/or vector falls into a scalar type
994
994
// or aggregate, but the current default implicit behaviour is to
@@ -997,19 +997,19 @@ getDefaultmapIfPresent(DefaultMapsTy &defaultMaps, mlir::Type varType) {
997
997
if ((fir::isa_trivial (varType) || fir::isa_char (varType) ||
998
998
fir::isa_builtin_cptr_type (varType)) &&
999
999
llvm::is_contained (defaultMaps, DefMap::VariableCategory::Scalar))
1000
- return defaultMaps[ DefMap::VariableCategory::Scalar] ;
1000
+ return defaultMaps. at ( DefMap::VariableCategory::Scalar) ;
1001
1001
1002
1002
if (fir::isPointerType (varType) &&
1003
1003
llvm::is_contained (defaultMaps, DefMap::VariableCategory::Pointer))
1004
- return defaultMaps[ DefMap::VariableCategory::Pointer] ;
1004
+ return defaultMaps. at ( DefMap::VariableCategory::Pointer) ;
1005
1005
1006
1006
if (fir::isAllocatableType (varType) &&
1007
1007
llvm::is_contained (defaultMaps, DefMap::VariableCategory::Allocatable))
1008
- return defaultMaps[ DefMap::VariableCategory::Allocatable] ;
1008
+ return defaultMaps. at ( DefMap::VariableCategory::Allocatable) ;
1009
1009
1010
1010
if (fir::isa_aggregate (varType) &&
1011
1011
llvm::is_contained (defaultMaps, DefMap::VariableCategory::Aggregate))
1012
- return defaultMaps[ DefMap::VariableCategory::Aggregate] ;
1012
+ return defaultMaps. at ( DefMap::VariableCategory::Aggregate) ;
1013
1013
1014
1014
return DefMap::ImplicitBehavior::Default;
1015
1015
}
@@ -1018,7 +1018,7 @@ static std::pair<llvm::omp::OpenMPOffloadMappingFlags,
1018
1018
mlir::omp::VariableCaptureKind>
1019
1019
getImplicitMapTypeAndKind (fir::FirOpBuilder &firOpBuilder,
1020
1020
lower::AbstractConverter &converter,
1021
- DefaultMapsTy &defaultMaps, mlir::Type varType,
1021
+ const DefaultMapsTy &defaultMaps, mlir::Type varType,
1022
1022
mlir::Location loc, const semantics::Symbol &sym) {
1023
1023
using DefMap = clause::Defaultmap;
1024
1024
// Check if a value of type `type` can be passed to the kernel by value.
0 commit comments