[Mlir-commits] [mlir] baf8a39 - [mlir] Apply ClangTidy fix.

Adrian Kuegel llvmlistbot at llvm.org
Tue Jan 2 00:56:19 PST 2024


Author: Adrian Kuegel
Date: 2024-01-02T08:55:37Z
New Revision: baf8a39aaf8b61a38b5b2b5591deb765e42eb00b

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

LOG: [mlir] Apply ClangTidy fix.

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

Added: 
    

Modified: 
    mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
index 45e0632db5ef2b..f484eda3268db0 100644
--- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
+++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
@@ -628,7 +628,7 @@ template <typename Op>
 static LogicalResult verifyDeviceTypeCountMatch(Op op, OperandRange operands,
                                                 ArrayAttr deviceTypes,
                                                 llvm::StringRef keyword) {
-  if (operands.size() > 0 && deviceTypes.getValue().size() != operands.size())
+  if (!operands.empty() && deviceTypes.getValue().size() != operands.size())
     return op.emitOpError() << keyword << " operands count must match "
                             << keyword << " device_type count";
   return success();


        


More information about the Mlir-commits mailing list