@@ -84,6 +84,7 @@ bool CheckerLivenessInfo::compute() {
84
84
while (SILValue value = defUseWorklist.pop ()) {
85
85
LLVM_DEBUG (llvm::dbgs () << " New Value: " << value);
86
86
SWIFT_DEFER { LLVM_DEBUG (llvm::dbgs () << " Finished Value: " << value); };
87
+
87
88
for (Operand *use : value->getUses ()) {
88
89
auto *user = use->getUser ();
89
90
LLVM_DEBUG (llvm::dbgs () << " User: " << *user);
@@ -190,7 +191,6 @@ namespace {
190
191
struct MoveKillsCopyableValuesChecker {
191
192
SILFunction *fn;
192
193
CheckerLivenessInfo livenessInfo;
193
- SmallSetVector<MoveValueInst *, 1 > movesWithinLivenessBoundary;
194
194
195
195
MoveKillsCopyableValuesChecker (SILFunction *fn) : fn(fn) {}
196
196
bool check ();
@@ -377,7 +377,6 @@ bool MoveKillsCopyableValuesChecker::check() {
377
377
378
378
// Then look at all of our found consuming uses. See if any of these are
379
379
// _move that are within the boundary.
380
- SWIFT_DEFER { movesWithinLivenessBoundary.clear (); };
381
380
for (auto *use : livenessInfo.consumingUse ) {
382
381
if (auto *mvi = dyn_cast<MoveValueInst>(use->getUser ())) {
383
382
// Only emit diagnostics if our move value allows us to.
@@ -392,18 +391,12 @@ bool MoveKillsCopyableValuesChecker::check() {
392
391
LLVM_DEBUG (llvm::dbgs () << " Move Value: " << *mvi);
393
392
if (livenessInfo.liveness .isWithinBoundary (mvi)) {
394
393
LLVM_DEBUG (llvm::dbgs () << " WithinBoundary: Yes!\n " );
395
- movesWithinLivenessBoundary. insert ( mvi);
394
+ emitDiagnosticForMove (lexicalValue, varName, mvi);
396
395
} else {
397
396
LLVM_DEBUG (llvm::dbgs () << " WithinBoundary: No!\n " );
398
397
}
399
398
}
400
399
}
401
-
402
- // Ok, we found all of our moves that violate the boundary condition, lets
403
- // emit diagnostics for each of them.
404
- for (auto *mvi : movesWithinLivenessBoundary) {
405
- emitDiagnosticForMove (lexicalValue, varName, mvi);
406
- }
407
400
}
408
401
409
402
return false ;
0 commit comments