File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2013,8 +2013,13 @@ static Constraint *tryOptimizeGenericDisjunction(
20132013 llvm_unreachable (" covered switch" );
20142014}
20152015
2016- // Performance hack: favor operator overloads with decl or type we're already
2017- // binding elsewhere in this expression.
2016+ // / Populates the \c found vector with the indices of the given constraints
2017+ // / that have a matching type to an existing operator binding elsewhere in
2018+ // / the expression.
2019+ // /
2020+ // / Operator bindings that have a matching type to an existing binding
2021+ // / are attempted first by the solver because it's very common to chain
2022+ // / operators of the same type together.
20182023static void existingOperatorBindingsForDisjunction (ConstraintSystem &CS,
20192024 ArrayRef<Constraint *> constraints,
20202025 SmallVectorImpl<unsigned > &found) {
@@ -2056,7 +2061,6 @@ static void existingOperatorBindingsForDisjunction(ConstraintSystem &CS,
20562061void ConstraintSystem::partitionDisjunction (
20572062 ArrayRef<Constraint *> Choices, SmallVectorImpl<unsigned > &Ordering,
20582063 SmallVectorImpl<unsigned > &PartitionBeginning) {
2059-
20602064 // Apply a special-case rule for favoring one generic function over
20612065 // another.
20622066 if (auto favored = tryOptimizeGenericDisjunction (DC, Choices)) {
You can’t perform that action at this time.
0 commit comments