[Mlir-commits] [mlir] mlir/Presburger: contribute a free-standing parser (PR #94916)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Jul 2 04:05:53 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff db791b278a414fb6df1acc1799adcf11d8fb9169 3545795998e71f190abadb829aae21224d2cf58d -- mlir/lib/Analysis/Presburger/Parser/Flattener.cpp mlir/lib/Analysis/Presburger/Parser/Flattener.h mlir/lib/Analysis/Presburger/Parser/Lexer.cpp mlir/lib/Analysis/Presburger/Parser/Lexer.h mlir/lib/Analysis/Presburger/Parser/ParseStructs.cpp mlir/lib/Analysis/Presburger/Parser/ParseStructs.h mlir/lib/Analysis/Presburger/Parser/ParserImpl.cpp mlir/lib/Analysis/Presburger/Parser/ParserImpl.h mlir/lib/Analysis/Presburger/Parser/Token.cpp mlir/lib/Analysis/Presburger/Parser/Token.h mlir/include/mlir/Analysis/Presburger/Matrix.h mlir/lib/Analysis/Presburger/Matrix.cpp mlir/unittests/Analysis/Presburger/BarvinokTest.cpp mlir/unittests/Analysis/Presburger/FractionTest.cpp mlir/unittests/Analysis/Presburger/GeneratingFunctionTest.cpp mlir/unittests/Analysis/Presburger/IntegerPolyhedronTest.cpp mlir/unittests/Analysis/Presburger/IntegerRelationTest.cpp mlir/unittests/Analysis/Presburger/MatrixTest.cpp mlir/unittests/Analysis/Presburger/PWMAFunctionTest.cpp mlir/unittests/Analysis/Presburger/ParserTest.cpp mlir/unittests/Analysis/Presburger/PresburgerRelationTest.cpp mlir/unittests/Analysis/Presburger/PresburgerSetTest.cpp mlir/unittests/Analysis/Presburger/QuasiPolynomialTest.cpp mlir/unittests/Analysis/Presburger/SimplexTest.cpp mlir/unittests/Analysis/Presburger/Utils.h mlir/include/mlir/Analysis/Presburger/Parser.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Analysis/Presburger/Parser/ParseStructs.h b/mlir/lib/Analysis/Presburger/Parser/ParseStructs.h
index ecf8428acd..fcafcf940e 100644
--- a/mlir/lib/Analysis/Presburger/Parser/ParseStructs.h
+++ b/mlir/lib/Analysis/Presburger/Parser/ParseStructs.h
@@ -74,9 +74,7 @@ struct CoefficientVector {
}
ArrayRef<int64_t> getCoefficients() const { return coefficients; }
- int64_t getConstant() const {
- return coefficients[info.getConstantIdx()];
- }
+ int64_t getConstant() const { return coefficients[info.getConstantIdx()]; }
size_t size() const { return coefficients.size(); }
operator ArrayRef<int64_t>() const { return coefficients; }
void resize(size_t size) { coefficients.resize(size); }
@@ -223,20 +221,14 @@ struct PureAffineExprImpl {
constexpr bool isMod() const { return kind == DivKind::Mod; }
constexpr bool hasDivisor() const { return divisor != 1; }
- bool isLinear() const {
- return nestedDivTerms.empty() && !hasDivisor();
- }
+ bool isLinear() const { return nestedDivTerms.empty() && !hasDivisor(); }
constexpr int64_t getDivisor() const { return divisor; }
constexpr int64_t getMulFactor() const { return mulFactor; }
bool isConstant() const {
return nestedDivTerms.empty() && getLinearDividend().isConstant();
}
- int64_t getConstant() const {
- return getLinearDividend().getConstant();
- }
- size_t hash() const {
- return std::hash<const PureAffineExprImpl *>{}(this);
- }
+ int64_t getConstant() const { return getLinearDividend().getConstant(); }
+ size_t hash() const { return std::hash<const PureAffineExprImpl *>{}(this); }
ArrayRef<PureAffineExpr> getNestedDivTerms() const { return nestedDivTerms; }
PureAffineExprImpl &mulConstant(int64_t c) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/94916
More information about the Mlir-commits
mailing list