[Openmp-commits] [openmp] d2636dc - [OpenMP][NFC] Fix diagnostic warnings

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 27 16:03:20 PST 2023


Author: Johannes Doerfert
Date: 2023-11-27T16:02:34-08:00
New Revision: d2636dc39043f6adda3a6797fc5b7966bd4cb2f0

URL: https://github.com/llvm/llvm-project/commit/d2636dc39043f6adda3a6797fc5b7966bd4cb2f0
DIFF: https://github.com/llvm/llvm-project/commit/d2636dc39043f6adda3a6797fc5b7966bd4cb2f0.diff

LOG: [OpenMP][NFC] Fix diagnostic warnings

Added: 
    

Modified: 
    openmp/libomptarget/src/omptarget.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/src/omptarget.cpp b/openmp/libomptarget/src/omptarget.cpp
index 0da448fdbefa477..318fd77920f6f0e 100644
--- a/openmp/libomptarget/src/omptarget.cpp
+++ b/openmp/libomptarget/src/omptarget.cpp
@@ -71,7 +71,7 @@ int32_t AsyncInfoTy::runPostProcessing() {
 
   // Clear the vector up until the last known function, since post-processing
   // procedures might add new procedures themselves.
-  const auto PrevBegin = PostProcessingFunctions.begin();
+  const auto *PrevBegin = PostProcessingFunctions.begin();
   PostProcessingFunctions.erase(PrevBegin, PrevBegin + Size);
 
   return OFFLOAD_SUCCESS;
@@ -297,8 +297,8 @@ void handleTargetOutcome(bool Success, ident_t *Loc) {
       if (PM->RTLs.UsedRTLs.empty()) {
         llvm::SmallVector<llvm::StringRef> Archs;
         llvm::transform(PM->Images, std::back_inserter(Archs),
-                        [](const auto &x) {
-                          return !x.second.Arch ? "empty" : x.second.Arch;
+                        [](const auto &X) {
+                          return !X.second.Arch ? "empty" : X.second.Arch;
                         });
         FAILURE_MESSAGE(
             "No images found compatible with the installed hardware. ");
@@ -473,7 +473,7 @@ void *targetLockExplicit(void *HostPtr, size_t Size, int DeviceNum,
     return NULL;
   }
 
-  void *rc = NULL;
+  void *RC = NULL;
 
   if (!deviceIsReady(DeviceNum)) {
     DP("%s returns NULL ptr\n", Name);
@@ -492,16 +492,16 @@ void *targetLockExplicit(void *HostPtr, size_t Size, int DeviceNum,
     DevicePtr = PM->Devices[DeviceNum].get();
   }
 
-  int32_t err = 0;
+  int32_t Err = 0;
   if (DevicePtr->RTL->data_lock) {
-    err = DevicePtr->RTL->data_lock(DeviceNum, HostPtr, Size, &rc);
-    if (err) {
+    Err = DevicePtr->RTL->data_lock(DeviceNum, HostPtr, Size, &RC);
+    if (Err) {
       DP("Could not lock ptr %p\n", HostPtr);
       return nullptr;
     }
   }
-  DP("%s returns device ptr " DPxMOD "\n", Name, DPxPTR(rc));
-  return rc;
+  DP("%s returns device ptr " DPxMOD "\n", Name, DPxPTR(RC));
+  return RC;
 }
 
 void targetUnlockExplicit(void *HostPtr, int DeviceNum, const char *Name) {
@@ -1264,7 +1264,7 @@ class PrivateArgumentManagerTy {
 
     FirstPrivateArgInfoTy(int Index, void *HstPtr, uint32_t Size,
                           uint32_t Alignment, uint32_t Padding,
-                          const map_var_info_t HstPtrName = nullptr)
+                          map_var_info_t HstPtrName = nullptr)
         : HstPtrBegin(reinterpret_cast<char *>(HstPtr)),
           HstPtrEnd(HstPtrBegin + Size), Index(Index), Alignment(Alignment),
           Size(Size), Padding(Padding), HstPtrName(HstPtrName) {}
@@ -1298,7 +1298,7 @@ class PrivateArgumentManagerTy {
   /// Add a private argument
   int addArg(void *HstPtr, int64_t ArgSize, int64_t ArgOffset,
              bool IsFirstPrivate, void *&TgtPtr, int TgtArgsIndex,
-             const map_var_info_t HstPtrName = nullptr,
+             map_var_info_t HstPtrName = nullptr,
              const bool AllocImmediately = false) {
     // If the argument is not first-private, or its size is greater than a
     // predefined threshold, we will allocate memory and issue the transfer
@@ -1385,7 +1385,7 @@ class PrivateArgumentManagerTy {
       assert(FirstPrivateArgSize != 0 &&
              "FirstPrivateArgSize is 0 but FirstPrivateArgInfo is empty");
       FirstPrivateArgBuffer.resize(FirstPrivateArgSize, 0);
-      auto Itr = FirstPrivateArgBuffer.begin();
+      auto *Itr = FirstPrivateArgBuffer.begin();
       // Copy all host data to this buffer
       for (FirstPrivateArgInfoTy &Info : FirstPrivateArgInfo) {
         // 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,
 /// and informing the record-replayer of whether to store the output
 /// in some file.
 int target_activate_rr(DeviceTy &Device, uint64_t MemorySize, void *VAddr,
-                       bool isRecord, bool SaveOutput,
+                       bool IsRecord, bool SaveOutput,
                        uint64_t &ReqPtrArgOffset) {
   return Device.RTL->activate_record_replay(Device.DeviceID, MemorySize, VAddr,
-                                            isRecord, SaveOutput,
+                                            IsRecord, SaveOutput,
                                             ReqPtrArgOffset);
 }
 


        


More information about the Openmp-commits mailing list