[Mlir-commits] [mlir] ba2b2b5 - [mlir][OpenMP] Apply ClangTidy readability finding.

Adrian Kuegel llvmlistbot at llvm.org
Wed Aug 31 01:39:14 PDT 2022


Author: Adrian Kuegel
Date: 2022-08-31T10:38:19+02:00
New Revision: ba2b2b595fc3419425e274c18f96c0f60ef539e8

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

LOG: [mlir][OpenMP] Apply ClangTidy readability finding.

Use .empty() check instead of size() check.

Added: 
    

Modified: 
    mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
index b4e05c58bb019..46f1ed36366a0 100644
--- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
@@ -707,7 +707,7 @@ LogicalResult TaskLoopOp::verify() {
           verifyReductionVarList(*this, in_reductions(), in_reduction_vars())))
     return failure();
 
-  if (reduction_vars().size() > 0 && nogroup())
+  if (!reduction_vars().empty() && nogroup())
     return emitError("if a reduction clause is present on the taskloop "
                      "directive, the nogroup clause must not be specified");
   for (auto var : reduction_vars()) {


        


More information about the Mlir-commits mailing list