[clang] [Clang] Improve subsumption. (PR #132849)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 25 04:49:51 PDT 2025
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 c1ed4f642396c1bbea2cc0cd6d2e46ff674145a4 89d4851dc81ed27706e1c7fd7522c4d5fd4c1074 --extensions h,cpp -- clang/test/SemaCXX/concepts-subsumption.cpp clang/include/clang/Sema/SemaConcept.h clang/lib/Sema/SemaConcept.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang/Sema/SemaConcept.h b/clang/include/clang/Sema/SemaConcept.h
index 696fc4b97a..9e61773ea5 100644
--- a/clang/include/clang/Sema/SemaConcept.h
+++ b/clang/include/clang/Sema/SemaConcept.h
@@ -230,9 +230,8 @@ private:
DNFFormula DNF(const NormalizedConstraint &C);
template <typename FormulaType>
- FormulaType
- Normalize(const NormalizedConstraint &C,
- bool ParentWillDoCrossProduct);
+ FormulaType Normalize(const NormalizedConstraint &C,
+ bool ParentWillDoCrossProduct);
void AddNonRedundantClauseToFormula(Formula &F, Clause C);
void AddUniqueClauseToFormula(Formula &F, Clause C);
bool IsSuperSet(const Clause &A, const Clause &B);
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 5497415680..6acb950d03 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -2031,10 +2031,12 @@ auto SubsumptionChecker::find(FoldExpandedConstraint *Ori) -> Literal {
}
auto SubsumptionChecker::CNF(const NormalizedConstraint &C) -> CNFFormula {
- return SubsumptionChecker::Normalize<CNFFormula>(C, /*ParentWillDoCrossProduct=*/false);
+ return SubsumptionChecker::Normalize<CNFFormula>(
+ C, /*ParentWillDoCrossProduct=*/false);
}
auto SubsumptionChecker::DNF(const NormalizedConstraint &C) -> DNFFormula {
- return SubsumptionChecker::Normalize<DNFFormula>(C, /*ParentWillDoCrossProduct=*/false);
+ return SubsumptionChecker::Normalize<DNFFormula>(
+ C, /*ParentWillDoCrossProduct=*/false);
}
///
@@ -2080,8 +2082,12 @@ FormulaType SubsumptionChecker::Normalize(const NormalizedConstraint &NC,
FormulaType Left, Right;
SemaRef.runWithSufficientStackSpace(SourceLocation(), [&] {
- Left = Normalize<FormulaType>(NC.getLHS(), ParentWillDoCrossProduct || NC.getCompoundKind() != FormulaType::Kind);
- Right = Normalize<FormulaType>(NC.getRHS(), ParentWillDoCrossProduct || NC.getCompoundKind() != FormulaType::Kind);
+ Left = Normalize<FormulaType>(NC.getLHS(), ParentWillDoCrossProduct ||
+ NC.getCompoundKind() !=
+ FormulaType::Kind);
+ Right = Normalize<FormulaType>(NC.getRHS(), ParentWillDoCrossProduct ||
+ NC.getCompoundKind() !=
+ FormulaType::Kind);
});
if (NC.getCompoundKind() == FormulaType::Kind) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/132849
More information about the cfe-commits
mailing list