@@ -1354,7 +1354,6 @@ struct GatherUsesVisitor final : public TransitiveAddressWalker {
1354
1354
MoveOnlyAddressCheckerPImpl &moveChecker;
1355
1355
UseState &useState;
1356
1356
MarkMustCheckInst *markedValue;
1357
- bool emittedEarlyDiagnostic = false ;
1358
1357
DiagnosticEmitter &diagnosticEmitter;
1359
1358
1360
1359
// Pruned liveness used to validate that load [take]/load [copy] can be
@@ -1529,14 +1528,13 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1529
1528
if (isa<ProjectBoxInst>(stripAccessMarkers (markedValue->getOperand ()))) {
1530
1529
LLVM_DEBUG (llvm::dbgs ()
1531
1530
<< " Found mark must check [nocopy] use of escaping box: " << *user);
1532
- diagnosticEmitter.emitAddressEscapingClosureCaptureLoadedAndConsumed (markedValue);
1533
- emittedEarlyDiagnostic = true ;
1531
+ diagnosticEmitter.emitAddressEscapingClosureCaptureLoadedAndConsumed (
1532
+ markedValue) ;
1534
1533
return true ;
1535
1534
}
1536
1535
LLVM_DEBUG (llvm::dbgs ()
1537
1536
<< " Found mark must check [nocopy] error: " << *user);
1538
1537
diagnosticEmitter.emitAddressDiagnosticNoCopy (markedValue, copyAddr);
1539
- emittedEarlyDiagnostic = true ;
1540
1538
return true ;
1541
1539
}
1542
1540
@@ -1592,15 +1590,13 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1592
1590
.didEmitCheckerDoesntUnderstandDiagnostic ());
1593
1591
LLVM_DEBUG (llvm::dbgs ()
1594
1592
<< " Failed to perform borrow to destructure transform!\n " );
1595
- emittedEarlyDiagnostic = true ;
1596
1593
return false ;
1597
1594
}
1598
1595
1599
1596
// If we emitted an error diagnostic, do not transform further and instead
1600
1597
// mark that we emitted an early diagnostic and return true.
1601
1598
if (numDiagnostics != moveChecker.diagnosticEmitter .getDiagnosticCount ()) {
1602
1599
LLVM_DEBUG (llvm::dbgs () << " Emitting borrow to destructure error!\n " );
1603
- emittedEarlyDiagnostic = true ;
1604
1600
return true ;
1605
1601
}
1606
1602
@@ -1621,7 +1617,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1621
1617
if (numDiagnostics != moveChecker.diagnosticEmitter .getDiagnosticCount ()) {
1622
1618
LLVM_DEBUG (llvm::dbgs ()
1623
1619
<< " Emitting destructure through deinit error!\n " );
1624
- emittedEarlyDiagnostic = true ;
1625
1620
return true ;
1626
1621
}
1627
1622
@@ -1646,7 +1641,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1646
1641
moveChecker.diagnosticEmitter
1647
1642
.emitAddressEscapingClosureCaptureLoadedAndConsumed (markedValue);
1648
1643
}
1649
- emittedEarlyDiagnostic = true ;
1650
1644
return true ;
1651
1645
}
1652
1646
@@ -1660,7 +1654,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1660
1654
1661
1655
if (checkForExclusivityHazards (li)) {
1662
1656
LLVM_DEBUG (llvm::dbgs () << " Found exclusivity violation?!\n " );
1663
- emittedEarlyDiagnostic = true ;
1664
1657
return true ;
1665
1658
}
1666
1659
@@ -1693,7 +1686,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1693
1686
// succeeded.
1694
1687
// Otherwise, emit the diagnostic.
1695
1688
moveChecker.diagnosticEmitter .emitObjectOwnedDiagnostic (markedValue);
1696
- emittedEarlyDiagnostic = true ;
1697
1689
LLVM_DEBUG (llvm::dbgs () << " Emitted early object level diagnostic.\n " );
1698
1690
return true ;
1699
1691
}
@@ -1702,7 +1694,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1702
1694
LLVM_DEBUG (llvm::dbgs () << " Found potential borrow inst: " << *user);
1703
1695
if (checkForExclusivityHazards (li)) {
1704
1696
LLVM_DEBUG (llvm::dbgs () << " Found exclusivity violation?!\n " );
1705
- emittedEarlyDiagnostic = true ;
1706
1697
return true ;
1707
1698
}
1708
1699
@@ -1751,7 +1742,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1751
1742
moveChecker.diagnosticEmitter
1752
1743
.emitAddressEscapingClosureCaptureLoadedAndConsumed (markedValue);
1753
1744
}
1754
- emittedEarlyDiagnostic = true ;
1755
1745
return true ;
1756
1746
}
1757
1747
0 commit comments