Skip to content

Commit ebac915

Browse files
committed
[NFC] Drop bogus closure interface type reset
1 parent 746b58e commit ebac915

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ namespace {
378378
llvm::DenseMap<Expr*, Type> ExprTypes;
379379
llvm::DenseMap<TypeLoc*, Type> TypeLocTypes;
380380
llvm::DenseMap<Pattern*, Type> PatternTypes;
381-
llvm::DenseMap<ParamDecl*, Type> ParamDeclInterfaceTypes;
382381
ExprTypeSaverAndEraser(const ExprTypeSaverAndEraser&) = delete;
383382
void operator=(const ExprTypeSaverAndEraser&) = delete;
384383
public:
@@ -417,17 +416,6 @@ namespace {
417416
if (isa<LiteralExpr>(expr) && !isa<InterpolatedStringLiteralExpr>(expr) &&
418417
!(expr->getType() && expr->getType()->hasError()))
419418
return { false, expr };
420-
421-
// If a ClosureExpr's parameter list has types on the decls, then
422-
// remove them so that they'll get regenerated from the
423-
// associated TypeLocs or resynthesized as fresh typevars.
424-
if (auto *CE = dyn_cast<ClosureExpr>(expr))
425-
for (auto P : *CE->getParameters()) {
426-
if (P->hasInterfaceType()) {
427-
TS->ParamDeclInterfaceTypes[P] = P->getInterfaceType();
428-
P->setInterfaceType(Type());
429-
}
430-
}
431419

432420
expr->setType(nullptr);
433421

@@ -470,12 +458,6 @@ namespace {
470458

471459
for (auto patternElt : PatternTypes)
472460
patternElt.first->setType(patternElt.second);
473-
474-
for (auto paramDeclIfaceElt : ParamDeclInterfaceTypes) {
475-
assert(!paramDeclIfaceElt.first->isImmutable() ||
476-
!paramDeclIfaceElt.second->is<InOutType>());
477-
paramDeclIfaceElt.first->setInterfaceType(paramDeclIfaceElt.second->getInOutObjectType());
478-
}
479461

480462
// Done, don't do redundant work on destruction.
481463
ExprTypes.clear();
@@ -502,33 +484,6 @@ namespace {
502484
for (auto patternElt : PatternTypes)
503485
if (!patternElt.first->hasType())
504486
patternElt.first->setType(patternElt.second);
505-
506-
for (auto paramDeclIfaceElt : ParamDeclInterfaceTypes)
507-
if (!paramDeclIfaceElt.first->hasInterfaceType()) {
508-
paramDeclIfaceElt.first->setInterfaceType(
509-
getParamBaseType(paramDeclIfaceElt));
510-
}
511-
}
512-
513-
private:
514-
static Type getParamBaseType(std::pair<ParamDecl *, Type> &storedParam) {
515-
ParamDecl *param;
516-
Type storedType;
517-
518-
std::tie(param, storedType) = storedParam;
519-
520-
// FIXME: We are currently in process of removing `InOutType`
521-
// so `VarDecl::get{Interface}Type` is going to wrap base
522-
// type into `InOutType` if its flag indicates that it's
523-
// an `inout` parameter declaration. But such type can't
524-
// be restored directly using `VarDecl::set{Interface}Type`
525-
// caller needs additional logic to extract base type.
526-
if (auto *IOT = storedType->getAs<InOutType>()) {
527-
assert(param->isInOut());
528-
return IOT->getObjectType();
529-
}
530-
531-
return storedType;
532487
}
533488
};
534489
} // end anonymous namespace

0 commit comments

Comments
 (0)