Skip to content

Commit 5a27eb4

Browse files
authored
Merge pull request #24360 from slavapestov/silgen-constructor-cleanup
SILGen: Small cleanup for emitClassConstructorAllocator()
2 parents 8103416 + 9a901b5 commit 5a27eb4

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

lib/SILGen/SILGenConstructor.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -568,17 +568,7 @@ void SILGenFunction::emitClassConstructorAllocator(ConstructorDecl *ctor) {
568568
SILType initTy;
569569

570570
// Call the initializer.
571-
SubstitutionMap subMap;
572-
if (auto *genericEnv = ctor->getGenericEnvironmentOfContext()) {
573-
auto *genericSig = genericEnv->getGenericSignature();
574-
subMap = SubstitutionMap::get(
575-
genericSig,
576-
[&](SubstitutableType *t) -> Type {
577-
return genericEnv->mapTypeIntoContext(
578-
t->castTo<GenericTypeParamType>());
579-
},
580-
MakeAbstractConformanceForGenericType());
581-
}
571+
auto subMap = F.getForwardingSubstitutionMap();
582572

583573
std::tie(initVal, initTy)
584574
= emitSiblingMethodRef(Loc, selfValue, initConstant, subMap);

0 commit comments

Comments
 (0)