Skip to content

Commit fa55358

Browse files
committed
[CSBindings] const qualify ConstraintSystem passed to inference methods
1 parent de645d0 commit fa55358

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ using namespace swift;
2222
using namespace constraints;
2323

2424
void ConstraintSystem::PotentialBindings::inferTransitiveBindings(
25-
ConstraintSystem &cs, llvm::SmallPtrSetImpl<CanType> &existingTypes,
25+
const ConstraintSystem &cs, llvm::SmallPtrSetImpl<CanType> &existingTypes,
2626
const llvm::SmallDenseMap<TypeVariableType *,
2727
ConstraintSystem::PotentialBindings>
2828
&inferredBindings) {
@@ -119,7 +119,7 @@ isUnviableDefaultType(Type defaultType,
119119
}
120120

121121
void ConstraintSystem::PotentialBindings::inferDefaultTypes(
122-
ConstraintSystem &cs, llvm::SmallPtrSetImpl<CanType> &existingTypes) {
122+
const ConstraintSystem &cs, llvm::SmallPtrSetImpl<CanType> &existingTypes) {
123123
auto isDirectRequirement = [&](Constraint *constraint) -> bool {
124124
if (auto *typeVar = constraint->getFirstType()->getAs<TypeVariableType>()) {
125125
auto *repr = cs.getRepresentative(typeVar);
@@ -275,7 +275,7 @@ void ConstraintSystem::PotentialBindings::inferDefaultTypes(
275275
}
276276

277277
void ConstraintSystem::PotentialBindings::finalize(
278-
ConstraintSystem &cs,
278+
const ConstraintSystem &cs,
279279
const llvm::SmallDenseMap<TypeVariableType *,
280280
ConstraintSystem::PotentialBindings>
281281
&inferredBindings) {

lib/Sema/ConstraintSystem.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4595,20 +4595,21 @@ class ConstraintSystem {
45954595
/// \param inferredBindings The set of all bindings inferred for type
45964596
/// variables in the workset.
45974597
void inferTransitiveBindings(
4598-
ConstraintSystem &cs, llvm::SmallPtrSetImpl<CanType> &existingTypes,
4598+
const ConstraintSystem &cs,
4599+
llvm::SmallPtrSetImpl<CanType> &existingTypes,
45994600
const llvm::SmallDenseMap<TypeVariableType *,
46004601
ConstraintSystem::PotentialBindings>
46014602
&inferredBindings);
46024603

46034604
/// Infer bindings based on any protocol conformances that have default
46044605
/// types.
4605-
void inferDefaultTypes(ConstraintSystem &cs,
4606+
void inferDefaultTypes(const ConstraintSystem &cs,
46064607
llvm::SmallPtrSetImpl<CanType> &existingTypes);
46074608

46084609
public:
46094610
/// Finalize binding computation for this type variable by
46104611
/// inferring bindings from context e.g. transitive bindings.
4611-
void finalize(ConstraintSystem &cs,
4612+
void finalize(const ConstraintSystem &cs,
46124613
const llvm::SmallDenseMap<TypeVariableType *,
46134614
ConstraintSystem::PotentialBindings>
46144615
&inferredBindings);

0 commit comments

Comments
 (0)