[Mlir-commits] [mlir] 658a4fd - [mlir] Apply ClangTidy fix (NFC)

Adrian Kuegel llvmlistbot at llvm.org
Tue Sep 5 01:17:52 PDT 2023


Author: Adrian Kuegel
Date: 2023-09-05T10:16:55+02:00
New Revision: 658a4fdb26a4b25c32372cb4709f2186bacca1f3

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

LOG: [mlir] Apply ClangTidy fix (NFC)

Prefer to use .empty() instead of checking size().

Added: 
    

Modified: 
    mlir/lib/Target/LLVM/NVVM/Target.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/LLVM/NVVM/Target.cpp b/mlir/lib/Target/LLVM/NVVM/Target.cpp
index 77352cb3bc6c67e..20b423009ef2c56 100644
--- a/mlir/lib/Target/LLVM/NVVM/Target.cpp
+++ b/mlir/lib/Target/LLVM/NVVM/Target.cpp
@@ -122,7 +122,7 @@ ArrayRef<std::string> SerializeGPUModuleBase::getFileList() const {
 // Try to append `libdevice` from a CUDA toolkit installation.
 LogicalResult SerializeGPUModuleBase::appendStandardLibs() {
   StringRef pathRef = getToolkitPath();
-  if (pathRef.size()) {
+  if (!pathRef.empty()) {
     SmallVector<char, 256> path;
     path.insert(path.begin(), pathRef.begin(), pathRef.end());
     pathRef = StringRef(path.data(), path.size());


        


More information about the Mlir-commits mailing list