@@ -7389,36 +7389,34 @@ ExtendedExistentialTypeShapeInfo::get(CanType existentialType) {
7389
7389
existentialType = metatype.getInstanceType ();
7390
7390
}
7391
7391
7392
- auto genInfo = ExistentialTypeGeneralization::get (existentialType);
7392
+ auto &ctx = existentialType->getASTContext ();
7393
+ auto existentialSig = ctx.getOpenedExistentialSignature (existentialType);
7393
7394
7394
- auto result = get (genInfo, metatypeDepth);
7395
- result.genSubs = genInfo.Generalization ;
7396
- return result;
7397
- }
7398
-
7399
- ExtendedExistentialTypeShapeInfo
7400
- ExtendedExistentialTypeShapeInfo::get (
7401
- const ExistentialTypeGeneralization &genInfo,
7402
- unsigned metatypeDepth) {
7403
- auto shapeType = genInfo.Shape ->getCanonicalType ();
7395
+ auto shapeType = existentialSig.Shape ;
7404
7396
for (unsigned i = 0 ; i != metatypeDepth; ++i)
7405
7397
shapeType = CanExistentialMetatypeType::get (shapeType);
7406
7398
7407
7399
CanGenericSignature genSig;
7408
- if (genInfo.Generalization )
7409
- genSig = genInfo.Generalization .getGenericSignature ()
7410
- .getCanonicalSignature ();
7400
+ if (existentialSig.Generalization ) {
7401
+ genSig = existentialSig.Generalization .getGenericSignature ()
7402
+ .getCanonicalSignature ();
7403
+ }
7411
7404
7412
7405
auto linkage = getExistentialShapeLinkage (genSig, shapeType);
7413
7406
assert (linkage != FormalLinkage::PublicUnique && linkage != FormalLinkage::PackageUnique);
7414
7407
7415
- return { genSig, shapeType, SubstitutionMap (), linkage };
7408
+ return {genSig,
7409
+ shapeType,
7410
+ existentialSig.Generalization ,
7411
+ existentialSig.OpenedSig ,
7412
+ linkage};
7416
7413
}
7417
7414
7418
7415
llvm::Constant *
7419
7416
irgen::emitExtendedExistentialTypeShape (IRGenModule &IGM,
7420
7417
const ExtendedExistentialTypeShapeInfo &info) {
7421
7418
CanGenericSignature genSig = info.genSig ;
7419
+ CanGenericSignature reqSig = info.reqSig ;
7422
7420
CanType shapeType = info.shapeType ;
7423
7421
bool isUnique = info.isUnique ();
7424
7422
bool isShared = info.isShared ();
@@ -7451,11 +7449,9 @@ irgen::emitExtendedExistentialTypeShape(IRGenModule &IGM,
7451
7449
metatypeDepth++;
7452
7450
}
7453
7451
7454
- CanGenericSignature reqSig =
7455
- IGM.Context .getOpenedExistentialSignature (existentialType, genSig);
7456
-
7457
7452
CanType typeExpression;
7458
7453
if (metatypeDepth > 0 ) {
7454
+ // FIXME: reqSig.getGenericParams()[0] is always tau_0_0
7459
7455
typeExpression = CanType (reqSig.getGenericParams ()[0 ]);
7460
7456
for (unsigned i = 0 ; i != metatypeDepth; ++i)
7461
7457
typeExpression = CanMetatypeType::get (typeExpression);
0 commit comments