mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SILGen: Small cleanup for emitClassConstructorAllocator()
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user