Skip to content

Commit 9447f21

Browse files
committed
[Sema] Rename last use of TVO_CannotBindToInOut to TVO_IsGenericTypeParam
1 parent 6452090 commit 9447f21

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,9 +1079,8 @@ void ConstraintSystem::openGeneric(
10791079
locatorPtr = getConstraintLocator(
10801080
locator.withPathElement(LocatorPathElt(archetype)));
10811081

1082-
// XXX -- Only a few tests crash if TVO_CannotBindToInOut is removed.
10831082
auto typeVar = createTypeVariable(locatorPtr,
1084-
TVO_CannotBindToInOut |
1083+
TVO_IsGenericTypeParam |
10851084
TVO_PrefersSubtypeBinding);
10861085
auto result = replacements.insert(
10871086
std::make_pair(cast<GenericTypeParamType>(gp->getCanonicalType()),

lib/Sema/ConstraintSystem.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ enum TypeVariableOptions {
161161
/// Whether the type variable can be bound to an lvalue type or not.
162162
TVO_CanBindToLValue = 0x01,
163163

164-
/// Whether the type variable can be bound to an inout type or not.
165-
TVO_CannotBindToInOut = 0x02,
164+
/// Whether the type variable is a generic type parameter or not.
165+
TVO_IsGenericTypeParam = 0x02,
166166

167167
/// Whether a more specific deduction for this type variable implies a
168168
/// better solution to the constraint system.
@@ -225,7 +225,7 @@ class TypeVariableType::Implementation {
225225

226226
/// Whether this type variable can bind to an inout type.
227227
bool canBindToInOut() const {
228-
return !(getRawOptions() & TVO_CannotBindToInOut);
228+
return !(getRawOptions() & TVO_IsGenericTypeParam);
229229
}
230230

231231
/// Whether this type variable prefers a subtype binding over a supertype
@@ -348,7 +348,7 @@ class TypeVariableType::Implementation {
348348
if (record)
349349
recordBinding(*record);
350350
getTypeVariable()->Bits.TypeVariableType.Options &= ~TVO_CanBindToLValue;
351-
getTypeVariable()->Bits.TypeVariableType.Options |= TVO_CannotBindToInOut;
351+
getTypeVariable()->Bits.TypeVariableType.Options |=TVO_IsGenericTypeParam;
352352
}
353353
}
354354

@@ -392,7 +392,7 @@ class TypeVariableType::Implementation {
392392
rep->getImpl().getTypeVariable()->Bits.TypeVariableType.Options
393393
&= ~TVO_CanBindToLValue;
394394
rep->getImpl().getTypeVariable()->Bits.TypeVariableType.Options
395-
|= TVO_CannotBindToInOut;
395+
|= TVO_IsGenericTypeParam;
396396
}
397397
}
398398

0 commit comments

Comments
 (0)