@@ -1486,7 +1486,7 @@ void DelegatingInitElementUseCollector::collectClassInitSelfUses() {
1486
1486
1487
1487
// For class initializers, the assign into the self box may be
1488
1488
// captured as SelfInit or SuperInit elsewhere.
1489
- if (TheMemory. isClassInitSelf () && isa<AssignInst>(User) &&
1489
+ if (isa<AssignInst>(User) &&
1490
1490
Op->getOperandNumber () == 1 ) {
1491
1491
// If the source of the assignment is an application of a C
1492
1492
// function, there is no metatype argument, so treat the
@@ -1541,13 +1541,8 @@ void DelegatingInitElementUseCollector::collectClassInitSelfUses() {
1541
1541
UseInfo.trackUse (DIMemoryUse (User, DIUseKind::Escape, 0 , 1 ));
1542
1542
}
1543
1543
1544
- if (TheMemory.isClassInitSelf ()) {
1545
- assert (StoresOfArgumentToSelf == 1 &&
1546
- " The 'self' argument should have been stored into the box exactly once" );
1547
- } else {
1548
- assert (StoresOfArgumentToSelf == 0 &&
1549
- " Initializing constructor for class-constrained protocol extension?" );
1550
- }
1544
+ assert (StoresOfArgumentToSelf == 1 &&
1545
+ " The 'self' argument should have been stored into the box exactly once" );
1551
1546
1552
1547
// The MUI must be used on an alloc_box or alloc_stack instruction. If we have
1553
1548
// an alloc_stack, there is nothing further to do.
@@ -1719,7 +1714,7 @@ void swift::ownership::collectDIElementUsesFrom(
1719
1714
// collector.
1720
1715
if (MemoryInfo.isDelegatingInit ()) {
1721
1716
DelegatingInitElementUseCollector UseCollector (MemoryInfo, UseInfo);
1722
- if (MemoryInfo.getType ()-> hasReferenceSemantics ()) {
1717
+ if (MemoryInfo.isClassInitSelf ()) {
1723
1718
UseCollector.collectClassInitSelfUses ();
1724
1719
} else {
1725
1720
UseCollector.collectValueTypeInitSelfUses ();
0 commit comments