================ @@ -143,13 +148,116 @@ struct NormalizedConstraint { return Constraint.get<AtomicConstraint *>(); } + FoldExpandedConstraint *getFoldExpandedConstraint() const { + assert(isFoldExpanded() && + "getFoldExpandedConstraint called on non-fold-expanded constraint."); + return Constraint.get<FoldExpandedConstraint *>(); + } + private: static std::optional<NormalizedConstraint> fromConstraintExprs(Sema &S, NamedDecl *D, ArrayRef<const Expr *> E); static std::optional<NormalizedConstraint> fromConstraintExpr(Sema &S, NamedDecl *D, const Expr *E); }; +struct FoldExpandedConstraint { + enum class FoldOperatorKind { FoAnd, FoOr } Kind; + NormalizedConstraint Constraint; + const Expr *Pattern; + + FoldExpandedConstraint(FoldOperatorKind K, NormalizedConstraint C, + const Expr *Pattern) + : Kind(K), Constraint(std::move(C)), Pattern(Pattern) {}; + + template <typename AtomicSubsumptionEvaluator> + bool subsumes(const FoldExpandedConstraint &Other, + AtomicSubsumptionEvaluator E) const; ---------------- AaronBallman wrote:
Should this be taking a `&&` for `E`? https://github.com/llvm/llvm-project/pull/98160 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits