[Mlir-commits] [mlir] 0d12628 - Apply clang-tidy fixes for readability-container-size-empty in SerializeNVVMTarget.cpp (NFC)

Mehdi Amini llvmlistbot at llvm.org
Wed Feb 21 18:09:33 PST 2024


Author: Mehdi Amini
Date: 2024-02-21T18:09:10-08:00
New Revision: 0d12628d06b8ab37157faea474548735ddb7eeb2

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

LOG: Apply clang-tidy fixes for readability-container-size-empty in SerializeNVVMTarget.cpp (NFC)

Added: 
    

Modified: 
    mlir/unittests/Target/LLVM/SerializeNVVMTarget.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/unittests/Target/LLVM/SerializeNVVMTarget.cpp b/mlir/unittests/Target/LLVM/SerializeNVVMTarget.cpp
index 924708f99902fe..26bfbd5c11e81e 100644
--- a/mlir/unittests/Target/LLVM/SerializeNVVMTarget.cpp
+++ b/mlir/unittests/Target/LLVM/SerializeNVVMTarget.cpp
@@ -85,7 +85,7 @@ TEST_F(MLIRTargetLLVMNVVM, SKIP_WITHOUT_NVPTX(SerializeNVVMMToLLVM)) {
         serializer.serializeToObject(gpuModule, options);
     // Check that the serializer was successful.
     ASSERT_TRUE(object != std::nullopt);
-    ASSERT_TRUE(object->size() > 0);
+    ASSERT_TRUE(!object->empty());
 
     // Read the serialized module.
     llvm::MemoryBufferRef buffer(StringRef(object->data(), object->size()),
@@ -121,7 +121,7 @@ TEST_F(MLIRTargetLLVMNVVM, SKIP_WITHOUT_NVPTX(SerializeNVVMToPTX)) {
         serializer.serializeToObject(gpuModule, options);
     // Check that the serializer was successful.
     ASSERT_TRUE(object != std::nullopt);
-    ASSERT_TRUE(object->size() > 0);
+    ASSERT_TRUE(!object->empty());
 
     ASSERT_TRUE(
         StringRef(object->data(), object->size()).contains("nvvm_kernel"));
@@ -151,6 +151,6 @@ TEST_F(MLIRTargetLLVMNVVM, SKIP_WITHOUT_NVPTX(SerializeNVVMToBinary)) {
         serializer.serializeToObject(gpuModule, options);
     // Check that the serializer was successful.
     ASSERT_TRUE(object != std::nullopt);
-    ASSERT_TRUE(object->size() > 0);
+    ASSERT_TRUE(!object->empty());
   }
 }


        


More information about the Mlir-commits mailing list