[Mlir-commits] [mlir] b238a0d - [mlir] Apply ClangTidy findings.

Adrian Kuegel llvmlistbot at llvm.org
Tue Jan 2 00:53:14 PST 2024


Author: Adrian Kuegel
Date: 2024-01-02T08:53:01Z
New Revision: b238a0d989bd8047d9b9ce48ad401c13d981e187

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

LOG: [mlir] Apply ClangTidy findings.

- Remove redundant return
- Use .empty() instead of size() == 0.

Added: 
    

Modified: 
    mlir/lib/Analysis/Presburger/Matrix.cpp
    mlir/lib/Analysis/Presburger/QuasiPolynomial.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/Presburger/Matrix.cpp b/mlir/lib/Analysis/Presburger/Matrix.cpp
index 1f1188c115a8b5..b68a7b7004bba9 100644
--- a/mlir/lib/Analysis/Presburger/Matrix.cpp
+++ b/mlir/lib/Analysis/Presburger/Matrix.cpp
@@ -645,5 +645,4 @@ void FracMatrix::LLL(Fraction delta) {
       k = k > 1 ? k - 1 : 1;
     }
   }
-  return;
 }

diff  --git a/mlir/lib/Analysis/Presburger/QuasiPolynomial.cpp b/mlir/lib/Analysis/Presburger/QuasiPolynomial.cpp
index 3ae4fb726215f7..feed683a203cff 100644
--- a/mlir/lib/Analysis/Presburger/QuasiPolynomial.cpp
+++ b/mlir/lib/Analysis/Presburger/QuasiPolynomial.cpp
@@ -23,7 +23,7 @@ QuasiPolynomial::QuasiPolynomial(
 #ifndef NDEBUG
   // For each term which involves at least one affine function,
   for (const std::vector<SmallVector<Fraction>> &term : affine) {
-    if (term.size() == 0)
+    if (term.empty())
       continue;
     // the number of elements in each affine function is
     // one more than the number of symbols.
@@ -112,4 +112,4 @@ QuasiPolynomial QuasiPolynomial::simplify() {
     newAffine.push_back(affine[i]);
   }
   return QuasiPolynomial(getNumInputs(), newCoeffs, newAffine);
-}
\ No newline at end of file
+}


        


More information about the Mlir-commits mailing list