@@ -91,10 +91,6 @@ namespace {
91
91
92
92
llvm::SmallVector<BinaryExpr *, 4 > binaryExprs;
93
93
94
- // TODO: manage as a set of lists, to speed up addition of binding
95
- // constraints.
96
- llvm::SmallVector<DeclRefExpr *, 16 > anonClosureParams;
97
-
98
94
LinkedTypeInfo () {
99
95
haveIntLiteral = false ;
100
96
haveFloatLiteral = false ;
@@ -249,10 +245,7 @@ namespace {
249
245
250
246
if (auto DRE = dyn_cast<DeclRefExpr>(expr)) {
251
247
if (auto varDecl = dyn_cast<VarDecl>(DRE->getDecl ())) {
252
- if (isa<ParamDecl>(varDecl) &&
253
- cast<ParamDecl>(varDecl)->isAnonClosureParam ()) {
254
- LTI.anonClosureParams .push_back (DRE);
255
- } else if (CS.hasType (DRE)) {
248
+ if (CS.hasType (DRE)) {
256
249
LTI.collectedTypes .insert (CS.getType (DRE).getPointer ());
257
250
}
258
251
return { false , expr };
@@ -346,24 +339,6 @@ namespace {
346
339
347
340
expr->walk (LinkedExprAnalyzer (lti, CS));
348
341
349
- // Link anonymous closure params of the same index.
350
- // TODO: As stated above, we should bucket these whilst collecting the
351
- // exprs to avoid quadratic behavior.
352
- for (auto acp1 : lti.anonClosureParams ) {
353
- for (auto acp2 : lti.anonClosureParams ) {
354
- if (acp1 == acp2)
355
- continue ;
356
-
357
- if (acp1->getDecl ()->getBaseName () == acp2->getDecl ()->getBaseName ()) {
358
-
359
- auto tyvar1 = CS.getType (acp1)->getAs <TypeVariableType>();
360
- auto tyvar2 = CS.getType (acp2)->getAs <TypeVariableType>();
361
-
362
- mergeRepresentativeEquivalenceClasses (CS, tyvar1, tyvar2);
363
- }
364
- }
365
- }
366
-
367
342
auto mergeTypeVariables = [&](ArrayRef<TypeVariableType *> typeVars) {
368
343
if (typeVars.size () < 2 )
369
344
return ;
0 commit comments