@@ -1322,7 +1322,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
1322
1322
" Operand is of an ArchetypeType that does not exist in the "
1323
1323
" Caller's generic param list." );
1324
1324
if (auto OpenedA = getOpenedArchetypeOf (A)) {
1325
- auto *openingInst = F->getModule ().getOpenedArchetypeInst (OpenedA);
1325
+ auto *openingInst = F->getModule ().getOpenedArchetypeInst (OpenedA, F );
1326
1326
require (I == nullptr || openingInst == I ||
1327
1327
properlyDominates (openingInst, I),
1328
1328
" Use of an opened archetype should be dominated by a "
@@ -1456,7 +1456,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
1456
1456
FoundOpenedArchetypes.insert (A);
1457
1457
// Also check that they are properly tracked inside the current
1458
1458
// function.
1459
- auto *openingInst = F.getModule ().getOpenedArchetypeInst (A);
1459
+ auto *openingInst = F.getModule ().getOpenedArchetypeInst (A,
1460
+ AI->getFunction ());
1460
1461
require (openingInst == AI ||
1461
1462
properlyDominates (openingInst, AI),
1462
1463
" Use of an opened archetype should be dominated by a "
@@ -3404,7 +3405,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
3404
3405
auto archetype = getOpenedArchetypeOf (OEI->getType ().getASTType ());
3405
3406
require (archetype,
3406
3407
" open_existential_addr result must be an opened existential archetype" );
3407
- require (OEI->getModule ().getOpenedArchetypeInst (archetype) == OEI,
3408
+ require (OEI->getModule ().getOpenedArchetypeInst (archetype,
3409
+ OEI->getFunction ()) == OEI,
3408
3410
" Archetype opened by open_existential_addr should be registered in "
3409
3411
" SILFunction" );
3410
3412
@@ -3437,7 +3439,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
3437
3439
auto archetype = getOpenedArchetypeOf (resultInstanceTy);
3438
3440
require (archetype,
3439
3441
" open_existential_ref result must be an opened existential archetype" );
3440
- require (OEI->getModule ().getOpenedArchetypeInst (archetype) == OEI,
3442
+ require (OEI->getModule ().getOpenedArchetypeInst (archetype,
3443
+ OEI->getFunction ()) == OEI,
3441
3444
" Archetype opened by open_existential_ref should be registered in "
3442
3445
" SILFunction" );
3443
3446
}
@@ -3459,7 +3462,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
3459
3462
auto archetype = getOpenedArchetypeOf (resultInstanceTy);
3460
3463
require (archetype,
3461
3464
" open_existential_box result must be an opened existential archetype" );
3462
- require (OEI->getModule ().getOpenedArchetypeInst (archetype) == OEI,
3465
+ require (OEI->getModule ().getOpenedArchetypeInst (archetype,
3466
+ OEI->getFunction ()) == OEI,
3463
3467
" Archetype opened by open_existential_box should be registered in "
3464
3468
" SILFunction" );
3465
3469
}
@@ -3481,7 +3485,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
3481
3485
auto archetype = getOpenedArchetypeOf (resultInstanceTy);
3482
3486
require (archetype,
3483
3487
" open_existential_box_value result not an opened existential archetype" );
3484
- require (OEI->getModule ().getOpenedArchetypeInst (archetype) == OEI,
3488
+ require (OEI->getModule ().getOpenedArchetypeInst (archetype,
3489
+ OEI->getFunction ()) == OEI,
3485
3490
" Archetype opened by open_existential_box_value should be "
3486
3491
" registered in SILFunction" );
3487
3492
}
@@ -3527,7 +3532,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
3527
3532
require (archetype, " open_existential_metatype result must be an opened "
3528
3533
" existential metatype" );
3529
3534
require (
3530
- I->getModule ().getOpenedArchetypeInst (archetype) == I,
3535
+ I->getModule ().getOpenedArchetypeInst (archetype, I-> getFunction () ) == I,
3531
3536
" Archetype opened by open_existential_metatype should be registered in "
3532
3537
" SILFunction" );
3533
3538
}
@@ -3546,7 +3551,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
3546
3551
auto archetype = getOpenedArchetypeOf (OEI->getType ().getASTType ());
3547
3552
require (archetype, " open_existential_value result must be an opened "
3548
3553
" existential archetype" );
3549
- require (OEI->getModule ().getOpenedArchetypeInst (archetype) == OEI,
3554
+ require (OEI->getModule ().getOpenedArchetypeInst (archetype,
3555
+ OEI->getFunction ()) == OEI,
3550
3556
" Archetype opened by open_existential should be registered in "
3551
3557
" SILFunction" );
3552
3558
}
@@ -3834,7 +3840,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
3834
3840
SILValue Def;
3835
3841
if (t->isOpenedExistential ()) {
3836
3842
auto archetypeTy = cast<ArchetypeType>(t);
3837
- Def = I->getModule ().getOpenedArchetypeInst (archetypeTy);
3843
+ Def = I->getModule ().getOpenedArchetypeInst (archetypeTy, I-> getFunction () );
3838
3844
require (Def, " Opened archetype should be registered in SILModule" );
3839
3845
} else if (t->hasDynamicSelfType ()) {
3840
3846
require (I->getFunction ()->hasSelfParam () ||
0 commit comments