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