@@ -152,7 +152,6 @@ bool ConstraintSystem::PotentialBindings::isPotentiallyIncomplete() const {
152152}
153153
154154void ConstraintSystem::PotentialBindings::inferTransitiveProtocolRequirements (
155- const ConstraintSystem &cs,
156155 llvm::SmallDenseMap<TypeVariableType *, ConstraintSystem::PotentialBindings>
157156 &inferredBindings) {
158157 if (TransitiveProtocols)
@@ -283,7 +282,6 @@ void ConstraintSystem::PotentialBindings::inferTransitiveProtocolRequirements(
283282}
284283
285284void ConstraintSystem::PotentialBindings::inferTransitiveBindings (
286- ConstraintSystem &cs,
287285 const llvm::SmallDenseMap<TypeVariableType *,
288286 ConstraintSystem::PotentialBindings>
289287 &inferredBindings) {
@@ -353,11 +351,10 @@ void ConstraintSystem::PotentialBindings::inferTransitiveBindings(
353351}
354352
355353void ConstraintSystem::PotentialBindings::finalize (
356- ConstraintSystem &cs,
357354 llvm::SmallDenseMap<TypeVariableType *, ConstraintSystem::PotentialBindings>
358355 &inferredBindings) {
359- inferTransitiveProtocolRequirements (cs, inferredBindings);
360- inferTransitiveBindings (cs, inferredBindings);
356+ inferTransitiveProtocolRequirements (inferredBindings);
357+ inferTransitiveBindings (inferredBindings);
361358}
362359
363360Optional<ConstraintSystem::PotentialBindings>
@@ -411,7 +408,7 @@ ConstraintSystem::determineBestBindings() {
411408 // produce a default type.
412409 bool isViable = isViableForRanking (bindings);
413410
414- bindings.finalize (* this , cache);
411+ bindings.finalize (cache);
415412
416413 if (!bindings || !isViable)
417414 continue ;
@@ -775,7 +772,7 @@ ConstraintSystem::inferBindingsFor(TypeVariableType *typeVar, bool finalize) {
775772 typeVar, ConstraintGraph::GatheringKind::EquivalenceClass);
776773
777774 for (auto *constraint : constraints) {
778- bool failed = bindings.infer (* this , constraint);
775+ bool failed = bindings.infer (constraint);
779776
780777 // Upon inference failure let's produce an empty set of bindings.
781778 if (failed)
@@ -786,7 +783,7 @@ ConstraintSystem::inferBindingsFor(TypeVariableType *typeVar, bool finalize) {
786783 llvm::SmallDenseMap<TypeVariableType *, ConstraintSystem::PotentialBindings>
787784 inferred;
788785
789- bindings.finalize (* this , inferred);
786+ bindings.finalize (inferred);
790787 }
791788
792789 return bindings;
@@ -995,8 +992,7 @@ ConstraintSystem::getPotentialBindingForRelationalConstraint(
995992// / Retrieve the set of potential type bindings for the given
996993// / representative type variable, along with flags indicating whether
997994// / those types should be opened.
998- bool ConstraintSystem::PotentialBindings::infer (ConstraintSystem &cs,
999- Constraint *constraint) {
995+ bool ConstraintSystem::PotentialBindings::infer (Constraint *constraint) {
1000996 switch (constraint->getKind ()) {
1001997 case ConstraintKind::Bind:
1002998 case ConstraintKind::Equal:
@@ -1008,7 +1004,7 @@ bool ConstraintSystem::PotentialBindings::infer(ConstraintSystem &cs,
10081004 case ConstraintKind::OperatorArgumentConversion:
10091005 case ConstraintKind::OptionalObject: {
10101006 auto binding =
1011- cs .getPotentialBindingForRelationalConstraint (*this , constraint);
1007+ CS .getPotentialBindingForRelationalConstraint (*this , constraint);
10121008 if (!binding)
10131009 break ;
10141010
@@ -1036,7 +1032,7 @@ bool ConstraintSystem::PotentialBindings::infer(ConstraintSystem &cs,
10361032 // let's have it try `Void` as well because there is an
10371033 // implicit conversion `() -> T` to `() -> Void` and this
10381034 // helps to avoid creating a thunk to support it.
1039- auto voidType = cs .getASTContext ().TheEmptyTupleType ;
1035+ auto voidType = CS .getASTContext ().TheEmptyTupleType ;
10401036 if (locator->isLastElement <LocatorPathElt::ClosureResult>() &&
10411037 binding->Kind == AllowedBindingKind::Supertypes) {
10421038 (void )addPotentialBinding ({voidType, binding->Kind , constraint},
@@ -1053,7 +1049,7 @@ bool ConstraintSystem::PotentialBindings::infer(ConstraintSystem &cs,
10531049 // we try to bind the key path type first, which can allow us to discover
10541050 // additional bindings for the result type.
10551051 SmallPtrSet<TypeVariableType *, 4 > typeVars;
1056- findInferableTypeVars (cs .simplifyType (constraint->getThirdType ()),
1052+ findInferableTypeVars (CS .simplifyType (constraint->getThirdType ()),
10571053 typeVars);
10581054 if (typeVars.count (TypeVar)) {
10591055 DelayedBy.push_back (constraint);
@@ -1092,7 +1088,7 @@ bool ConstraintSystem::PotentialBindings::infer(ConstraintSystem &cs,
10921088 case ConstraintKind::Defaultable:
10931089 case ConstraintKind::DefaultClosureType:
10941090 // Do these in a separate pass.
1095- if (cs .getFixedTypeRecursive (constraint->getFirstType (), true )
1091+ if (CS .getFixedTypeRecursive (constraint->getFirstType (), true )
10961092 ->getAs <TypeVariableType>() == TypeVar) {
10971093 addDefault (constraint);
10981094 }
@@ -1133,9 +1129,9 @@ bool ConstraintSystem::PotentialBindings::infer(ConstraintSystem &cs,
11331129 // and if so it would be beneficial to bind member to a hole
11341130 // early to propagate that information down to arguments,
11351131 // result type of a call that references such a member.
1136- if (cs .shouldAttemptFixes () && TypeVar->getImpl ().canBindToHole ()) {
1132+ if (CS .shouldAttemptFixes () && TypeVar->getImpl ().canBindToHole ()) {
11371133 if (ConstraintSystem::typeVarOccursInType (
1138- TypeVar, cs .simplifyType (constraint->getSecondType ())))
1134+ TypeVar, CS .simplifyType (constraint->getSecondType ())))
11391135 break ;
11401136 }
11411137
0 commit comments