From 9a901b591c034db74715d13b92416380eae5a1cb Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 29 Apr 2019 10:36:41 -0400 Subject: [PATCH] SILGen: Small cleanup for emitClassConstructorAllocator() --- lib/SILGen/SILGenConstructor.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/SILGen/SILGenConstructor.cpp b/lib/SILGen/SILGenConstructor.cpp index f8b5db59d46..9e8140bf7f0 100644 --- a/lib/SILGen/SILGenConstructor.cpp +++ b/lib/SILGen/SILGenConstructor.cpp @@ -568,17 +568,7 @@ void SILGenFunction::emitClassConstructorAllocator(ConstructorDecl *ctor) { SILType initTy; // Call the initializer. - SubstitutionMap subMap; - if (auto *genericEnv = ctor->getGenericEnvironmentOfContext()) { - auto *genericSig = genericEnv->getGenericSignature(); - subMap = SubstitutionMap::get( - genericSig, - [&](SubstitutableType *t) -> Type { - return genericEnv->mapTypeIntoContext( - t->castTo()); - }, - MakeAbstractConformanceForGenericType()); - } + auto subMap = F.getForwardingSubstitutionMap(); std::tie(initVal, initTy) = emitSiblingMethodRef(Loc, selfValue, initConstant, subMap);