Skip to content

Commit 4d3f79f

Browse files
committed
[OpenMP] Resolve const cast issue introduced in D123446
1 parent 94d1453 commit 4d3f79f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

openmp/libomptarget/include/device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ struct HostDataToTargetTy {
251251
/// OFFLOAD_SUCCESS. The entry is locked for this operation.
252252
template <typename CBTy> int foreachShadowPointerInfo(CBTy CB) const {
253253
for (auto &It : States->ShadowPtrInfos)
254-
if (CB(It) == OFFLOAD_FAIL)
254+
if (CB(const_cast<ShadowPtrInfoTy &>(It)) == OFFLOAD_FAIL)
255255
return OFFLOAD_FAIL;
256256
return OFFLOAD_SUCCESS;
257257
}

openmp/libomptarget/src/omptarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ static int targetDataContiguous(ident_t *Loc, DeviceTy &Device, void *ArgsBase,
10381038
}
10391039
if (TPR.getEntry()) {
10401040
int Ret = TPR.getEntry()->foreachShadowPointerInfo(
1041-
[&](const ShadowPtrInfoTy &ShadowPtr) {
1041+
[&](ShadowPtrInfoTy &ShadowPtr) {
10421042
DP("Restoring original target pointer value " DPxMOD " for target "
10431043
"pointer " DPxMOD "\n",
10441044
DPxPTR(ShadowPtr.TgtPtrVal), DPxPTR(ShadowPtr.TgtPtrAddr));

0 commit comments

Comments
 (0)