@@ -459,7 +459,7 @@ namespace {
459
459
460
460
461
461
void handleStoreUse (unsigned UseID);
462
- void handleLoadUse (unsigned UseID );
462
+ void handleLoadUse (const DIMemoryUse &Use );
463
463
void handleLoadForTypeOfSelfUse (const DIMemoryUse &Use);
464
464
void handleInOutUse (const DIMemoryUse &Use);
465
465
void handleEscapeUse (const DIMemoryUse &Use);
@@ -765,15 +765,9 @@ void LifetimeChecker::doIt() {
765
765
handleStoreUse (i);
766
766
break ;
767
767
768
- case DIUseKind::IndirectIn: {
769
- bool IsSuperInitComplete, FailedSelfUse;
770
- // If the value is not definitively initialized, emit an error.
771
- if (!isInitializedAtUse (Use, &IsSuperInitComplete, &FailedSelfUse))
772
- handleLoadUseFailure (Use, IsSuperInitComplete, FailedSelfUse);
773
- break ;
774
- }
768
+ case DIUseKind::IndirectIn:
775
769
case DIUseKind::Load:
776
- handleLoadUse (i );
770
+ handleLoadUse (Use );
777
771
break ;
778
772
case DIUseKind::InOutArgument:
779
773
case DIUseKind::InOutSelfArgument:
@@ -814,9 +808,7 @@ void LifetimeChecker::doIt() {
814
808
handleConditionalDestroys (ControlVariable);
815
809
}
816
810
817
- void LifetimeChecker::handleLoadUse (unsigned UseID) {
818
- DIMemoryUse &Use = Uses[UseID];
819
-
811
+ void LifetimeChecker::handleLoadUse (const DIMemoryUse &Use) {
820
812
bool IsSuperInitComplete, FailedSelfUse;
821
813
// If the value is not definitively initialized, emit an error.
822
814
if (!isInitializedAtUse (Use, &IsSuperInitComplete, &FailedSelfUse))
@@ -2194,6 +2186,12 @@ SILValue LifetimeChecker::handleConditionalInitAssign() {
2194
2186
2195
2187
// Ignore deleted uses.
2196
2188
if (Use.Inst == nullptr ) continue ;
2189
+
2190
+ // If this ambiguous store is only of trivial types, then we don't need to
2191
+ // do anything special. We don't even need keep the init bit for the
2192
+ // element precise.
2193
+ if (Use.onlyTouchesTrivialElements (TheMemory))
2194
+ continue ;
2197
2195
2198
2196
B.setInsertionPoint (Use.Inst );
2199
2197
@@ -2209,23 +2207,12 @@ SILValue LifetimeChecker::handleConditionalInitAssign() {
2209
2207
2210
2208
case DIUseKind::SelfInit:
2211
2209
case DIUseKind::Initialization:
2212
- // If this is an initialization of only trivial elements, then we don't
2213
- // need to update the bitvector.
2214
- if (Use.onlyTouchesTrivialElements (TheMemory))
2215
- continue ;
2216
-
2217
2210
APInt Bitmask = Use.getElementBitmask (NumMemoryElements);
2218
2211
SILBuilderWithScope SB (Use.Inst );
2219
2212
updateControlVariable (Loc, Bitmask, ControlVariableAddr, OrFn, SB);
2220
2213
continue ;
2221
2214
}
2222
2215
2223
- // If this ambiguous store is only of trivial types, then we don't need to
2224
- // do anything special. We don't even need keep the init bit for the
2225
- // element precise.
2226
- if (Use.onlyTouchesTrivialElements (TheMemory))
2227
- continue ;
2228
-
2229
2216
// If this is the interesting case, we need to generate a CFG diamond for
2230
2217
// each element touched, destroying any live elements so that the resulting
2231
2218
// store is always an initialize. This disambiguates the dynamic
0 commit comments