Skip to content

Commit d2636dc

Browse files
committed
[OpenMP][NFC] Fix diagnostic warnings
1 parent 30fbe73 commit d2636dc

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

openmp/libomptarget/src/omptarget.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int32_t AsyncInfoTy::runPostProcessing() {
7171

7272
// Clear the vector up until the last known function, since post-processing
7373
// procedures might add new procedures themselves.
74-
const auto PrevBegin = PostProcessingFunctions.begin();
74+
const auto *PrevBegin = PostProcessingFunctions.begin();
7575
PostProcessingFunctions.erase(PrevBegin, PrevBegin + Size);
7676

7777
return OFFLOAD_SUCCESS;
@@ -297,8 +297,8 @@ void handleTargetOutcome(bool Success, ident_t *Loc) {
297297
if (PM->RTLs.UsedRTLs.empty()) {
298298
llvm::SmallVector<llvm::StringRef> Archs;
299299
llvm::transform(PM->Images, std::back_inserter(Archs),
300-
[](const auto &x) {
301-
return !x.second.Arch ? "empty" : x.second.Arch;
300+
[](const auto &X) {
301+
return !X.second.Arch ? "empty" : X.second.Arch;
302302
});
303303
FAILURE_MESSAGE(
304304
"No images found compatible with the installed hardware. ");
@@ -473,7 +473,7 @@ void *targetLockExplicit(void *HostPtr, size_t Size, int DeviceNum,
473473
return NULL;
474474
}
475475

476-
void *rc = NULL;
476+
void *RC = NULL;
477477

478478
if (!deviceIsReady(DeviceNum)) {
479479
DP("%s returns NULL ptr\n", Name);
@@ -492,16 +492,16 @@ void *targetLockExplicit(void *HostPtr, size_t Size, int DeviceNum,
492492
DevicePtr = PM->Devices[DeviceNum].get();
493493
}
494494

495-
int32_t err = 0;
495+
int32_t Err = 0;
496496
if (DevicePtr->RTL->data_lock) {
497-
err = DevicePtr->RTL->data_lock(DeviceNum, HostPtr, Size, &rc);
498-
if (err) {
497+
Err = DevicePtr->RTL->data_lock(DeviceNum, HostPtr, Size, &RC);
498+
if (Err) {
499499
DP("Could not lock ptr %p\n", HostPtr);
500500
return nullptr;
501501
}
502502
}
503-
DP("%s returns device ptr " DPxMOD "\n", Name, DPxPTR(rc));
504-
return rc;
503+
DP("%s returns device ptr " DPxMOD "\n", Name, DPxPTR(RC));
504+
return RC;
505505
}
506506

507507
void targetUnlockExplicit(void *HostPtr, int DeviceNum, const char *Name) {
@@ -1264,7 +1264,7 @@ class PrivateArgumentManagerTy {
12641264

12651265
FirstPrivateArgInfoTy(int Index, void *HstPtr, uint32_t Size,
12661266
uint32_t Alignment, uint32_t Padding,
1267-
const map_var_info_t HstPtrName = nullptr)
1267+
map_var_info_t HstPtrName = nullptr)
12681268
: HstPtrBegin(reinterpret_cast<char *>(HstPtr)),
12691269
HstPtrEnd(HstPtrBegin + Size), Index(Index), Alignment(Alignment),
12701270
Size(Size), Padding(Padding), HstPtrName(HstPtrName) {}
@@ -1298,7 +1298,7 @@ class PrivateArgumentManagerTy {
12981298
/// Add a private argument
12991299
int addArg(void *HstPtr, int64_t ArgSize, int64_t ArgOffset,
13001300
bool IsFirstPrivate, void *&TgtPtr, int TgtArgsIndex,
1301-
const map_var_info_t HstPtrName = nullptr,
1301+
map_var_info_t HstPtrName = nullptr,
13021302
const bool AllocImmediately = false) {
13031303
// If the argument is not first-private, or its size is greater than a
13041304
// predefined threshold, we will allocate memory and issue the transfer
@@ -1385,7 +1385,7 @@ class PrivateArgumentManagerTy {
13851385
assert(FirstPrivateArgSize != 0 &&
13861386
"FirstPrivateArgSize is 0 but FirstPrivateArgInfo is empty");
13871387
FirstPrivateArgBuffer.resize(FirstPrivateArgSize, 0);
1388-
auto Itr = FirstPrivateArgBuffer.begin();
1388+
auto *Itr = FirstPrivateArgBuffer.begin();
13891389
// Copy all host data to this buffer
13901390
for (FirstPrivateArgInfoTy &Info : FirstPrivateArgInfo) {
13911391
// First pad the pointer as we (have to) pad it on the device too.
@@ -1725,10 +1725,10 @@ int target(ident_t *Loc, DeviceTy &Device, void *HostPtr,
17251725
/// and informing the record-replayer of whether to store the output
17261726
/// in some file.
17271727
int target_activate_rr(DeviceTy &Device, uint64_t MemorySize, void *VAddr,
1728-
bool isRecord, bool SaveOutput,
1728+
bool IsRecord, bool SaveOutput,
17291729
uint64_t &ReqPtrArgOffset) {
17301730
return Device.RTL->activate_record_replay(Device.DeviceID, MemorySize, VAddr,
1731-
isRecord, SaveOutput,
1731+
IsRecord, SaveOutput,
17321732
ReqPtrArgOffset);
17331733
}
17341734

0 commit comments

Comments
 (0)