[Libomptarget][NFC] Fix linting warnings in the plugins

Summary:
Fix some linting warnings present in the plugins.
GitOrigin-RevId: e4f4022b7044b135a950a5fdc033af13fee9f6fa
diff --git a/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp b/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
index 598239d..fe435a3 100644
--- a/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -1246,7 +1246,7 @@
     AMDGPUSignalTy *OutputSignals[2] = {};
     if (auto Err = SignalManager.getResources(/*Num=*/2, OutputSignals))
       return Err;
-    for (auto Signal : OutputSignals) {
+    for (auto *Signal : OutputSignals) {
       Signal->reset();
       Signal->increaseUseCount();
     }
@@ -1312,7 +1312,7 @@
     AMDGPUSignalTy *OutputSignals[2] = {};
     if (auto Err = SignalManager.getResources(/*Num=*/2, OutputSignals))
       return Err;
-    for (auto Signal : OutputSignals) {
+    for (auto *Signal : OutputSignals) {
       Signal->reset();
       Signal->increaseUseCount();
     }
diff --git a/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h b/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
index 2d447c8..1cb99c0 100644
--- a/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
+++ b/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
@@ -53,7 +53,7 @@
   uint8_t Unused[56];
 };
 
-uint32_t getImplicitArgsSize(uint16_t Version) {
+inline uint32_t getImplicitArgsSize(uint16_t Version) {
   return Version < ELF::ELFABIVERSION_AMDGPU_HSA_V5
              ? sizeof(AMDGPUImplicitArgsTyCOV4)
              : sizeof(AMDGPUImplicitArgsTy);
@@ -173,44 +173,44 @@
     if (!V.first.isString())
       return Error::success();
 
-    const auto isKey = [](const msgpack::DocNode &DK, StringRef SK) {
+    const auto IsKey = [](const msgpack::DocNode &DK, StringRef SK) {
       return DK.getString() == SK;
     };
 
-    const auto getSequenceOfThreeInts = [](msgpack::DocNode &DN,
+    const auto GetSequenceOfThreeInts = [](msgpack::DocNode &DN,
                                            uint32_t *Vals) {
       assert(DN.isArray() && "MsgPack DocNode is an array node");
       auto DNA = DN.getArray();
       assert(DNA.size() == 3 && "ArrayNode has at most three elements");
 
-      int i = 0;
+      int I = 0;
       for (auto DNABegin = DNA.begin(), DNAEnd = DNA.end(); DNABegin != DNAEnd;
            ++DNABegin) {
-        Vals[i++] = DNABegin->getUInt();
+        Vals[I++] = DNABegin->getUInt();
       }
     };
 
-    if (isKey(V.first, ".name")) {
+    if (IsKey(V.first, ".name")) {
       KernelName = V.second.toString();
-    } else if (isKey(V.first, ".sgpr_count")) {
+    } else if (IsKey(V.first, ".sgpr_count")) {
       KernelData.SGPRCount = V.second.getUInt();
-    } else if (isKey(V.first, ".sgpr_spill_count")) {
+    } else if (IsKey(V.first, ".sgpr_spill_count")) {
       KernelData.SGPRSpillCount = V.second.getUInt();
-    } else if (isKey(V.first, ".vgpr_count")) {
+    } else if (IsKey(V.first, ".vgpr_count")) {
       KernelData.VGPRCount = V.second.getUInt();
-    } else if (isKey(V.first, ".vgpr_spill_count")) {
+    } else if (IsKey(V.first, ".vgpr_spill_count")) {
       KernelData.VGPRSpillCount = V.second.getUInt();
-    } else if (isKey(V.first, ".private_segment_fixed_size")) {
+    } else if (IsKey(V.first, ".private_segment_fixed_size")) {
       KernelData.PrivateSegmentSize = V.second.getUInt();
-    } else if (isKey(V.first, ".group_segement_fixed_size")) {
+    } else if (IsKey(V.first, ".group_segement_fixed_size")) {
       KernelData.GroupSegmentList = V.second.getUInt();
-    } else if (isKey(V.first, ".reqd_workgroup_size")) {
-      getSequenceOfThreeInts(V.second, KernelData.RequestedWorkgroupSize);
-    } else if (isKey(V.first, ".workgroup_size_hint")) {
-      getSequenceOfThreeInts(V.second, KernelData.WorkgroupSizeHint);
-    } else if (isKey(V.first, ".wavefront_size")) {
+    } else if (IsKey(V.first, ".reqd_workgroup_size")) {
+      GetSequenceOfThreeInts(V.second, KernelData.RequestedWorkgroupSize);
+    } else if (IsKey(V.first, ".workgroup_size_hint")) {
+      GetSequenceOfThreeInts(V.second, KernelData.WorkgroupSizeHint);
+    } else if (IsKey(V.first, ".wavefront_size")) {
       KernelData.WavefronSize = V.second.getUInt();
-    } else if (isKey(V.first, ".max_flat_workgroup_size")) {
+    } else if (IsKey(V.first, ".max_flat_workgroup_size")) {
       KernelData.MaxFlatWorkgroupSize = V.second.getUInt();
     }
 
@@ -273,9 +273,10 @@
 
 /// Reads the AMDGPU specific metadata from the ELF file and propagates the
 /// KernelInfoMap
-Error readAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer,
-                                  StringMap<KernelMetaDataTy> &KernelInfoMap,
-                                  uint16_t &ELFABIVersion) {
+inline Error
+readAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer,
+                            StringMap<KernelMetaDataTy> &KernelInfoMap,
+                            uint16_t &ELFABIVersion) {
   Error Err = Error::success(); // Used later as out-parameter
 
   auto ELFOrError = object::ELF64LEFile::create(MemBuffer.getBuffer());
diff --git a/libomptarget/plugins-nextgen/common/include/JIT.h b/libomptarget/plugins-nextgen/common/include/JIT.h
index 7252519..3ec4424 100644
--- a/libomptarget/plugins-nextgen/common/include/JIT.h
+++ b/libomptarget/plugins-nextgen/common/include/JIT.h
@@ -25,7 +25,6 @@
 
 #include <functional>
 #include <memory>
-#include <shared_mutex>
 #include <string>
 
 struct __tgt_device_image;
diff --git a/libomptarget/plugins-nextgen/common/src/Utils/ELF.cpp b/libomptarget/plugins-nextgen/common/src/Utils/ELF.cpp
index 85976ee..bdac6c1 100644
--- a/libomptarget/plugins-nextgen/common/src/Utils/ELF.cpp
+++ b/libomptarget/plugins-nextgen/common/src/Utils/ELF.cpp
@@ -12,9 +12,6 @@
 
 #include "Utils/ELF.h"
 
-#include "Shared/APITypes.h"
-#include "Shared/Debug.h"
-
 #include "llvm/BinaryFormat/Magic.h"
 #include "llvm/Object/Binary.h"
 #include "llvm/Object/ELFObjectFile.h"
diff --git a/libomptarget/plugins-nextgen/cuda/src/rtl.cpp b/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
index 9f59f1e..0c7535a 100644
--- a/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
+++ b/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
@@ -728,7 +728,7 @@
 
     // If there is already pending work on the stream it could be waiting for
     // someone to check the RPC server.
-    if (auto RPCServer = getRPCServer()) {
+    if (auto *RPCServer = getRPCServer()) {
       CUresult Res = cuStreamQuery(Stream);
       while (Res == CUDA_ERROR_NOT_READY) {
         if (auto Err = RPCServer->runServer(*this))
@@ -1088,7 +1088,7 @@
     }
 
     // Sort the created array to be in priority order.
-    llvm::sort(Funcs, [=](auto x, auto y) { return x.second < y.second; });
+    llvm::sort(Funcs, [=](auto X, auto Y) { return X.second < Y.second; });
 
     // Allocate a buffer to store all of the known constructor / destructor
     // functions in so we can iterate them on the device.