SILGen: Small cleanup for emitClassConstructorAllocator()

This commit is contained in:
Slava Pestov
2019-04-29 10:36:41 -04:00
parent ea80003b0c
commit 9a901b591c

View File

@@ -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<GenericTypeParamType>());
},
MakeAbstractConformanceForGenericType());
}
auto subMap = F.getForwardingSubstitutionMap();
std::tie(initVal, initTy)
= emitSiblingMethodRef(Loc, selfValue, initConstant, subMap);