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(
2013
2013
llvm_unreachable (" covered switch" );
2014
2014
}
2015
2015
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.
2018
2023
static void existingOperatorBindingsForDisjunction (ConstraintSystem &CS,
2019
2024
ArrayRef<Constraint *> constraints,
2020
2025
SmallVectorImpl<unsigned > &found) {
@@ -2056,7 +2061,6 @@ static void existingOperatorBindingsForDisjunction(ConstraintSystem &CS,
2056
2061
void ConstraintSystem::partitionDisjunction (
2057
2062
ArrayRef<Constraint *> Choices, SmallVectorImpl<unsigned > &Ordering,
2058
2063
SmallVectorImpl<unsigned > &PartitionBeginning) {
2059
-
2060
2064
// Apply a special-case rule for favoring one generic function over
2061
2065
// another.
2062
2066
if (auto favored = tryOptimizeGenericDisjunction (DC, Choices)) {
You can’t perform that action at this time.
0 commit comments