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; SILType initTy;
// Call the initializer. // Call the initializer.
SubstitutionMap subMap; auto subMap = F.getForwardingSubstitutionMap();
if (auto *genericEnv = ctor->getGenericEnvironmentOfContext()) {
auto *genericSig = genericEnv->getGenericSignature();
subMap = SubstitutionMap::get(
genericSig,
[&](SubstitutableType *t) -> Type {
return genericEnv->mapTypeIntoContext(
t->castTo<GenericTypeParamType>());
},
MakeAbstractConformanceForGenericType());
}
std::tie(initVal, initTy) std::tie(initVal, initTy)
= emitSiblingMethodRef(Loc, selfValue, initConstant, subMap); = emitSiblingMethodRef(Loc, selfValue, initConstant, subMap);