|
@@ -6645,17 +6645,17 @@ private:
|
|
struct MapInfo {
|
|
struct MapInfo {
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components;
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components;
|
|
OpenMPMapClauseKind MapType = OMPC_MAP_unknown;
|
|
OpenMPMapClauseKind MapType = OMPC_MAP_unknown;
|
|
- OpenMPMapClauseKind MapTypeModifier = OMPC_MAP_unknown;
|
|
|
|
|
|
+ ArrayRef<OpenMPMapModifierKind> MapModifiers;
|
|
bool ReturnDevicePointer = false;
|
|
bool ReturnDevicePointer = false;
|
|
bool IsImplicit = false;
|
|
bool IsImplicit = false;
|
|
|
|
|
|
MapInfo() = default;
|
|
MapInfo() = default;
|
|
MapInfo(
|
|
MapInfo(
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components,
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components,
|
|
- OpenMPMapClauseKind MapType, OpenMPMapClauseKind MapTypeModifier,
|
|
|
|
|
|
+ OpenMPMapClauseKind MapType,
|
|
|
|
+ ArrayRef<OpenMPMapModifierKind> MapModifiers,
|
|
bool ReturnDevicePointer, bool IsImplicit)
|
|
bool ReturnDevicePointer, bool IsImplicit)
|
|
- : Components(Components), MapType(MapType),
|
|
|
|
- MapTypeModifier(MapTypeModifier),
|
|
|
|
|
|
+ : Components(Components), MapType(MapType), MapModifiers(MapModifiers),
|
|
ReturnDevicePointer(ReturnDevicePointer), IsImplicit(IsImplicit) {}
|
|
ReturnDevicePointer(ReturnDevicePointer), IsImplicit(IsImplicit) {}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -6732,10 +6732,9 @@ private:
|
|
/// a flag marking the map as a pointer if requested. Add a flag marking the
|
|
/// a flag marking the map as a pointer if requested. Add a flag marking the
|
|
/// map as the first one of a series of maps that relate to the same map
|
|
/// map as the first one of a series of maps that relate to the same map
|
|
/// expression.
|
|
/// expression.
|
|
- OpenMPOffloadMappingFlags getMapTypeBits(OpenMPMapClauseKind MapType,
|
|
|
|
- OpenMPMapClauseKind MapTypeModifier,
|
|
|
|
- bool IsImplicit, bool AddPtrFlag,
|
|
|
|
- bool AddIsTargetParamFlag) const {
|
|
|
|
|
|
+ OpenMPOffloadMappingFlags getMapTypeBits(
|
|
|
|
+ OpenMPMapClauseKind MapType, ArrayRef<OpenMPMapModifierKind> MapModifiers,
|
|
|
|
+ bool IsImplicit, bool AddPtrFlag, bool AddIsTargetParamFlag) const {
|
|
OpenMPOffloadMappingFlags Bits =
|
|
OpenMPOffloadMappingFlags Bits =
|
|
IsImplicit ? OMP_MAP_IMPLICIT : OMP_MAP_NONE;
|
|
IsImplicit ? OMP_MAP_IMPLICIT : OMP_MAP_NONE;
|
|
switch (MapType) {
|
|
switch (MapType) {
|
|
@@ -6758,7 +6757,6 @@ private:
|
|
case OMPC_MAP_delete:
|
|
case OMPC_MAP_delete:
|
|
Bits |= OMP_MAP_DELETE;
|
|
Bits |= OMP_MAP_DELETE;
|
|
break;
|
|
break;
|
|
- case OMPC_MAP_always:
|
|
|
|
case OMPC_MAP_unknown:
|
|
case OMPC_MAP_unknown:
|
|
llvm_unreachable("Unexpected map type!");
|
|
llvm_unreachable("Unexpected map type!");
|
|
}
|
|
}
|
|
@@ -6766,7 +6764,8 @@ private:
|
|
Bits |= OMP_MAP_PTR_AND_OBJ;
|
|
Bits |= OMP_MAP_PTR_AND_OBJ;
|
|
if (AddIsTargetParamFlag)
|
|
if (AddIsTargetParamFlag)
|
|
Bits |= OMP_MAP_TARGET_PARAM;
|
|
Bits |= OMP_MAP_TARGET_PARAM;
|
|
- if (MapTypeModifier == OMPC_MAP_always)
|
|
|
|
|
|
+ if (llvm::find(MapModifiers, OMPC_MAP_MODIFIER_always)
|
|
|
|
+ != MapModifiers.end())
|
|
Bits |= OMP_MAP_ALWAYS;
|
|
Bits |= OMP_MAP_ALWAYS;
|
|
return Bits;
|
|
return Bits;
|
|
}
|
|
}
|
|
@@ -6815,7 +6814,8 @@ private:
|
|
/// \a IsFirstComponent should be set to true if the provided set of
|
|
/// \a IsFirstComponent should be set to true if the provided set of
|
|
/// components is the first associated with a capture.
|
|
/// components is the first associated with a capture.
|
|
void generateInfoForComponentList(
|
|
void generateInfoForComponentList(
|
|
- OpenMPMapClauseKind MapType, OpenMPMapClauseKind MapTypeModifier,
|
|
|
|
|
|
+ OpenMPMapClauseKind MapType,
|
|
|
|
+ ArrayRef<OpenMPMapModifierKind> MapModifiers,
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components,
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components,
|
|
MapBaseValuesArrayTy &BasePointers, MapValuesArrayTy &Pointers,
|
|
MapBaseValuesArrayTy &BasePointers, MapValuesArrayTy &Pointers,
|
|
MapValuesArrayTy &Sizes, MapFlagsArrayTy &Types,
|
|
MapValuesArrayTy &Sizes, MapFlagsArrayTy &Types,
|
|
@@ -7125,7 +7125,7 @@ private:
|
|
// Emit data for non-overlapped data.
|
|
// Emit data for non-overlapped data.
|
|
OpenMPOffloadMappingFlags Flags =
|
|
OpenMPOffloadMappingFlags Flags =
|
|
OMP_MAP_MEMBER_OF |
|
|
OMP_MAP_MEMBER_OF |
|
|
- getMapTypeBits(MapType, MapTypeModifier, IsImplicit,
|
|
|
|
|
|
+ getMapTypeBits(MapType, MapModifiers, IsImplicit,
|
|
/*AddPtrFlag=*/false,
|
|
/*AddPtrFlag=*/false,
|
|
/*AddIsTargetParamFlag=*/false);
|
|
/*AddIsTargetParamFlag=*/false);
|
|
LB = BP;
|
|
LB = BP;
|
|
@@ -7175,7 +7175,7 @@ private:
|
|
// this map is the first one that relates with the current capture
|
|
// this map is the first one that relates with the current capture
|
|
// (there is a set of entries for each capture).
|
|
// (there is a set of entries for each capture).
|
|
OpenMPOffloadMappingFlags Flags = getMapTypeBits(
|
|
OpenMPOffloadMappingFlags Flags = getMapTypeBits(
|
|
- MapType, MapTypeModifier, IsImplicit,
|
|
|
|
|
|
+ MapType, MapModifiers, IsImplicit,
|
|
!IsExpressionFirstInfo || IsLink, IsCaptureFirstInfo && !IsLink);
|
|
!IsExpressionFirstInfo || IsLink, IsCaptureFirstInfo && !IsLink);
|
|
|
|
|
|
if (!IsExpressionFirstInfo) {
|
|
if (!IsExpressionFirstInfo) {
|
|
@@ -7395,28 +7395,29 @@ public:
|
|
auto &&InfoGen = [&Info](
|
|
auto &&InfoGen = [&Info](
|
|
const ValueDecl *D,
|
|
const ValueDecl *D,
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef L,
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef L,
|
|
- OpenMPMapClauseKind MapType, OpenMPMapClauseKind MapModifier,
|
|
|
|
|
|
+ OpenMPMapClauseKind MapType,
|
|
|
|
+ ArrayRef<OpenMPMapModifierKind> MapModifiers,
|
|
bool ReturnDevicePointer, bool IsImplicit) {
|
|
bool ReturnDevicePointer, bool IsImplicit) {
|
|
const ValueDecl *VD =
|
|
const ValueDecl *VD =
|
|
D ? cast<ValueDecl>(D->getCanonicalDecl()) : nullptr;
|
|
D ? cast<ValueDecl>(D->getCanonicalDecl()) : nullptr;
|
|
- Info[VD].emplace_back(L, MapType, MapModifier, ReturnDevicePointer,
|
|
|
|
|
|
+ Info[VD].emplace_back(L, MapType, MapModifiers, ReturnDevicePointer,
|
|
IsImplicit);
|
|
IsImplicit);
|
|
};
|
|
};
|
|
|
|
|
|
// FIXME: MSVC 2013 seems to require this-> to find member CurDir.
|
|
// FIXME: MSVC 2013 seems to require this-> to find member CurDir.
|
|
for (const auto *C : this->CurDir.getClausesOfKind<OMPMapClause>())
|
|
for (const auto *C : this->CurDir.getClausesOfKind<OMPMapClause>())
|
|
for (const auto &L : C->component_lists()) {
|
|
for (const auto &L : C->component_lists()) {
|
|
- InfoGen(L.first, L.second, C->getMapType(), C->getMapTypeModifier(),
|
|
|
|
|
|
+ InfoGen(L.first, L.second, C->getMapType(), C->getMapTypeModifiers(),
|
|
/*ReturnDevicePointer=*/false, C->isImplicit());
|
|
/*ReturnDevicePointer=*/false, C->isImplicit());
|
|
}
|
|
}
|
|
for (const auto *C : this->CurDir.getClausesOfKind<OMPToClause>())
|
|
for (const auto *C : this->CurDir.getClausesOfKind<OMPToClause>())
|
|
for (const auto &L : C->component_lists()) {
|
|
for (const auto &L : C->component_lists()) {
|
|
- InfoGen(L.first, L.second, OMPC_MAP_to, OMPC_MAP_unknown,
|
|
|
|
|
|
+ InfoGen(L.first, L.second, OMPC_MAP_to, llvm::None,
|
|
/*ReturnDevicePointer=*/false, C->isImplicit());
|
|
/*ReturnDevicePointer=*/false, C->isImplicit());
|
|
}
|
|
}
|
|
for (const auto *C : this->CurDir.getClausesOfKind<OMPFromClause>())
|
|
for (const auto *C : this->CurDir.getClausesOfKind<OMPFromClause>())
|
|
for (const auto &L : C->component_lists()) {
|
|
for (const auto &L : C->component_lists()) {
|
|
- InfoGen(L.first, L.second, OMPC_MAP_from, OMPC_MAP_unknown,
|
|
|
|
|
|
+ InfoGen(L.first, L.second, OMPC_MAP_from, llvm::None,
|
|
/*ReturnDevicePointer=*/false, C->isImplicit());
|
|
/*ReturnDevicePointer=*/false, C->isImplicit());
|
|
}
|
|
}
|
|
|
|
|
|
@@ -7469,7 +7470,7 @@ public:
|
|
// Nonetheless, generateInfoForComponentList must be called to take
|
|
// Nonetheless, generateInfoForComponentList must be called to take
|
|
// the pointer into account for the calculation of the range of the
|
|
// the pointer into account for the calculation of the range of the
|
|
// partial struct.
|
|
// partial struct.
|
|
- InfoGen(nullptr, L.second, OMPC_MAP_unknown, OMPC_MAP_unknown,
|
|
|
|
|
|
+ InfoGen(nullptr, L.second, OMPC_MAP_unknown, llvm::None,
|
|
/*ReturnDevicePointer=*/false, C->isImplicit());
|
|
/*ReturnDevicePointer=*/false, C->isImplicit());
|
|
DeferredInfo[nullptr].emplace_back(IE, VD);
|
|
DeferredInfo[nullptr].emplace_back(IE, VD);
|
|
} else {
|
|
} else {
|
|
@@ -7503,7 +7504,7 @@ public:
|
|
unsigned CurrentBasePointersIdx = CurBasePointers.size();
|
|
unsigned CurrentBasePointersIdx = CurBasePointers.size();
|
|
// FIXME: MSVC 2013 seems to require this-> to find the member method.
|
|
// FIXME: MSVC 2013 seems to require this-> to find the member method.
|
|
this->generateInfoForComponentList(
|
|
this->generateInfoForComponentList(
|
|
- L.MapType, L.MapTypeModifier, L.Components, CurBasePointers,
|
|
|
|
|
|
+ L.MapType, L.MapModifiers, L.Components, CurBasePointers,
|
|
CurPointers, CurSizes, CurTypes, PartialStruct,
|
|
CurPointers, CurSizes, CurTypes, PartialStruct,
|
|
IsFirstComponentList, L.IsImplicit);
|
|
IsFirstComponentList, L.IsImplicit);
|
|
|
|
|
|
@@ -7662,7 +7663,7 @@ public:
|
|
|
|
|
|
using MapData =
|
|
using MapData =
|
|
std::tuple<OMPClauseMappableExprCommon::MappableExprComponentListRef,
|
|
std::tuple<OMPClauseMappableExprCommon::MappableExprComponentListRef,
|
|
- OpenMPMapClauseKind, OpenMPMapClauseKind, bool>;
|
|
|
|
|
|
+ OpenMPMapClauseKind, ArrayRef<OpenMPMapModifierKind>, bool>;
|
|
SmallVector<MapData, 4> DeclComponentLists;
|
|
SmallVector<MapData, 4> DeclComponentLists;
|
|
// FIXME: MSVC 2013 seems to require this-> to find member CurDir.
|
|
// FIXME: MSVC 2013 seems to require this-> to find member CurDir.
|
|
for (const auto *C : this->CurDir.getClausesOfKind<OMPMapClause>()) {
|
|
for (const auto *C : this->CurDir.getClausesOfKind<OMPMapClause>()) {
|
|
@@ -7672,7 +7673,7 @@ public:
|
|
assert(!L.second.empty() &&
|
|
assert(!L.second.empty() &&
|
|
"Not expecting declaration with no component lists.");
|
|
"Not expecting declaration with no component lists.");
|
|
DeclComponentLists.emplace_back(L.second, C->getMapType(),
|
|
DeclComponentLists.emplace_back(L.second, C->getMapType(),
|
|
- C->getMapTypeModifier(),
|
|
|
|
|
|
+ C->getMapTypeModifiers(),
|
|
C->isImplicit());
|
|
C->isImplicit());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -7688,13 +7689,13 @@ public:
|
|
for (const MapData &L : DeclComponentLists) {
|
|
for (const MapData &L : DeclComponentLists) {
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components;
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components;
|
|
OpenMPMapClauseKind MapType;
|
|
OpenMPMapClauseKind MapType;
|
|
- OpenMPMapClauseKind MapTypeModifier;
|
|
|
|
|
|
+ ArrayRef<OpenMPMapModifierKind> MapModifiers;
|
|
bool IsImplicit;
|
|
bool IsImplicit;
|
|
- std::tie(Components, MapType, MapTypeModifier, IsImplicit) = L;
|
|
|
|
|
|
+ std::tie(Components, MapType, MapModifiers, IsImplicit) = L;
|
|
++Count;
|
|
++Count;
|
|
for (const MapData &L1 : makeArrayRef(DeclComponentLists).slice(Count)) {
|
|
for (const MapData &L1 : makeArrayRef(DeclComponentLists).slice(Count)) {
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components1;
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components1;
|
|
- std::tie(Components1, MapType, MapTypeModifier, IsImplicit) = L1;
|
|
|
|
|
|
+ std::tie(Components1, MapType, MapModifiers, IsImplicit) = L1;
|
|
auto CI = Components.rbegin();
|
|
auto CI = Components.rbegin();
|
|
auto CE = Components.rend();
|
|
auto CE = Components.rend();
|
|
auto SI = Components1.rbegin();
|
|
auto SI = Components1.rbegin();
|
|
@@ -7778,13 +7779,13 @@ public:
|
|
const MapData &L = *Pair.getFirst();
|
|
const MapData &L = *Pair.getFirst();
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components;
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components;
|
|
OpenMPMapClauseKind MapType;
|
|
OpenMPMapClauseKind MapType;
|
|
- OpenMPMapClauseKind MapTypeModifier;
|
|
|
|
|
|
+ ArrayRef<OpenMPMapModifierKind> MapModifiers;
|
|
bool IsImplicit;
|
|
bool IsImplicit;
|
|
- std::tie(Components, MapType, MapTypeModifier, IsImplicit) = L;
|
|
|
|
|
|
+ std::tie(Components, MapType, MapModifiers, IsImplicit) = L;
|
|
ArrayRef<OMPClauseMappableExprCommon::MappableExprComponentListRef>
|
|
ArrayRef<OMPClauseMappableExprCommon::MappableExprComponentListRef>
|
|
OverlappedComponents = Pair.getSecond();
|
|
OverlappedComponents = Pair.getSecond();
|
|
bool IsFirstComponentList = true;
|
|
bool IsFirstComponentList = true;
|
|
- generateInfoForComponentList(MapType, MapTypeModifier, Components,
|
|
|
|
|
|
+ generateInfoForComponentList(MapType, MapModifiers, Components,
|
|
BasePointers, Pointers, Sizes, Types,
|
|
BasePointers, Pointers, Sizes, Types,
|
|
PartialStruct, IsFirstComponentList,
|
|
PartialStruct, IsFirstComponentList,
|
|
IsImplicit, OverlappedComponents);
|
|
IsImplicit, OverlappedComponents);
|
|
@@ -7794,12 +7795,12 @@ public:
|
|
for (const MapData &L : DeclComponentLists) {
|
|
for (const MapData &L : DeclComponentLists) {
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components;
|
|
OMPClauseMappableExprCommon::MappableExprComponentListRef Components;
|
|
OpenMPMapClauseKind MapType;
|
|
OpenMPMapClauseKind MapType;
|
|
- OpenMPMapClauseKind MapTypeModifier;
|
|
|
|
|
|
+ ArrayRef<OpenMPMapModifierKind> MapModifiers;
|
|
bool IsImplicit;
|
|
bool IsImplicit;
|
|
- std::tie(Components, MapType, MapTypeModifier, IsImplicit) = L;
|
|
|
|
|
|
+ std::tie(Components, MapType, MapModifiers, IsImplicit) = L;
|
|
auto It = OverlappedData.find(&L);
|
|
auto It = OverlappedData.find(&L);
|
|
if (It == OverlappedData.end())
|
|
if (It == OverlappedData.end())
|
|
- generateInfoForComponentList(MapType, MapTypeModifier, Components,
|
|
|
|
|
|
+ generateInfoForComponentList(MapType, MapModifiers, Components,
|
|
BasePointers, Pointers, Sizes, Types,
|
|
BasePointers, Pointers, Sizes, Types,
|
|
PartialStruct, IsFirstComponentList,
|
|
PartialStruct, IsFirstComponentList,
|
|
IsImplicit);
|
|
IsImplicit);
|
|
@@ -7828,7 +7829,7 @@ public:
|
|
continue;
|
|
continue;
|
|
StructRangeInfoTy PartialStruct;
|
|
StructRangeInfoTy PartialStruct;
|
|
generateInfoForComponentList(
|
|
generateInfoForComponentList(
|
|
- C->getMapType(), C->getMapTypeModifier(), L.second, BasePointers,
|
|
|
|
|
|
+ C->getMapType(), C->getMapTypeModifiers(), L.second, BasePointers,
|
|
Pointers, Sizes, Types, PartialStruct,
|
|
Pointers, Sizes, Types, PartialStruct,
|
|
/*IsFirstComponentList=*/true, C->isImplicit());
|
|
/*IsFirstComponentList=*/true, C->isImplicit());
|
|
assert(!PartialStruct.Base.isValid() &&
|
|
assert(!PartialStruct.Base.isValid() &&
|