@@ -1198,9 +1198,6 @@ struct Score {
1198
1198
// / variable.
1199
1199
using OpenedType = std::pair<GenericTypeParamType *, TypeVariableType *>;
1200
1200
1201
- using OpenedTypeMap =
1202
- llvm::DenseMap<GenericTypeParamType *, TypeVariableType *>;
1203
-
1204
1201
// / Describes the information about a case label item that needs to be tracked
1205
1202
// / within the constraint system.
1206
1203
struct CaseLabelItemInfo {
@@ -4236,7 +4233,7 @@ class ConstraintSystem {
4236
4233
// / corresponding opened type variables.
4237
4234
// /
4238
4235
// / \returns The opened type, or \c type if there are no archetypes in it.
4239
- Type openType (Type type, OpenedTypeMap & replacements,
4236
+ Type openType (Type type, ArrayRef<OpenedType> replacements,
4240
4237
ConstraintLocatorBuilder locator);
4241
4238
4242
4239
// / "Open" an opaque archetype type, similar to \c openType.
@@ -4247,7 +4244,7 @@ class ConstraintSystem {
4247
4244
// / opening its pattern and shape types and connecting them to the
4248
4245
// / aforementioned variable via special constraints.
4249
4246
Type openPackExpansionType (PackExpansionType *expansion,
4250
- OpenedTypeMap & replacements,
4247
+ ArrayRef<OpenedType> replacements,
4251
4248
ConstraintLocatorBuilder locator);
4252
4249
4253
4250
// / Update OpenedPackExpansionTypes and record a change in the trail.
@@ -4280,28 +4277,26 @@ class ConstraintSystem {
4280
4277
// / \returns The opened type, or \c type if there are no archetypes in it.
4281
4278
FunctionType *openFunctionType (AnyFunctionType *funcType,
4282
4279
ConstraintLocatorBuilder locator,
4283
- OpenedTypeMap &replacements,
4280
+ SmallVectorImpl<OpenedType> &replacements,
4284
4281
DeclContext *outerDC);
4285
4282
4286
4283
// / Open the generic parameter list and its requirements,
4287
4284
// / creating type variables for each of the type parameters.
4288
4285
void openGeneric (DeclContext *outerDC,
4289
4286
GenericSignature signature,
4290
4287
ConstraintLocatorBuilder locator,
4291
- OpenedTypeMap &replacements);
4288
+ SmallVectorImpl<OpenedType> &replacements);
4292
4289
4293
4290
// / Open the generic parameter list creating type variables for each of the
4294
4291
// / type parameters.
4295
4292
void openGenericParameters (DeclContext *outerDC,
4296
4293
GenericSignature signature,
4297
- OpenedTypeMap &replacements,
4294
+ SmallVectorImpl<OpenedType> &replacements,
4298
4295
ConstraintLocatorBuilder locator);
4299
4296
4300
4297
// / Open a generic parameter into a type variable and record
4301
4298
// / it in \c replacements.
4302
- TypeVariableType *openGenericParameter (DeclContext *outerDC,
4303
- GenericTypeParamType *parameter,
4304
- OpenedTypeMap &replacements,
4299
+ TypeVariableType *openGenericParameter (GenericTypeParamType *parameter,
4305
4300
ConstraintLocatorBuilder locator);
4306
4301
4307
4302
// / Given generic signature open its generic requirements,
@@ -4328,7 +4323,7 @@ class ConstraintSystem {
4328
4323
// / Record the set of opened types for the given locator.
4329
4324
void recordOpenedTypes (
4330
4325
ConstraintLocatorBuilder locator,
4331
- const OpenedTypeMap &replacements,
4326
+ SmallVectorImpl<OpenedType> &replacements,
4332
4327
bool fixmeAllowDuplicates=false );
4333
4328
4334
4329
// / Check whether the given type conforms to the given protocol and if
@@ -4340,7 +4335,7 @@ class ConstraintSystem {
4340
4335
FunctionType *adjustFunctionTypeForConcurrency (
4341
4336
FunctionType *fnType, Type baseType, ValueDecl *decl, DeclContext *dc,
4342
4337
unsigned numApplies, bool isMainDispatchQueue,
4343
- OpenedTypeMap & replacements, ConstraintLocatorBuilder locator);
4338
+ ArrayRef<OpenedType> replacements, ConstraintLocatorBuilder locator);
4344
4339
4345
4340
// / Retrieve the type of a reference to the given value declaration.
4346
4341
// /
@@ -4380,7 +4375,7 @@ class ConstraintSystem {
4380
4375
Type getMemberReferenceTypeFromOpenedType (
4381
4376
Type &openedType, Type baseObjTy, ValueDecl *value, DeclContext *outerDC,
4382
4377
ConstraintLocator *locator, bool hasAppliedSelf, bool isDynamicLookup,
4383
- OpenedTypeMap & replacements);
4378
+ ArrayRef<OpenedType> replacements);
4384
4379
4385
4380
// / Retrieve the type of a reference to the given value declaration,
4386
4381
// / as a member with a base of the given type.
@@ -4396,7 +4391,7 @@ class ConstraintSystem {
4396
4391
DeclReferenceType getTypeOfMemberReference (
4397
4392
Type baseTy, ValueDecl *decl, DeclContext *useDC, bool isDynamicLookup,
4398
4393
FunctionRefKind functionRefKind, ConstraintLocator *locator,
4399
- OpenedTypeMap *replacements = nullptr );
4394
+ SmallVectorImpl<OpenedType> *replacements = nullptr );
4400
4395
4401
4396
// / Retrieve a list of generic parameter types solver has "opened" (replaced
4402
4397
// / with a type variable) at the given location.
0 commit comments