@@ -1441,7 +1441,6 @@ struct GatherUsesVisitor final : public TransitiveAddressWalker {
1441
1441
MoveOnlyAddressCheckerPImpl &moveChecker;
1442
1442
UseState &useState;
1443
1443
MarkMustCheckInst *markedValue;
1444
- bool emittedEarlyDiagnostic = false ;
1445
1444
DiagnosticEmitter &diagnosticEmitter;
1446
1445
1447
1446
// Pruned liveness used to validate that load [take]/load [copy] can be
@@ -1616,14 +1615,13 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1616
1615
if (isa<ProjectBoxInst>(stripAccessMarkers (markedValue->getOperand ()))) {
1617
1616
LLVM_DEBUG (llvm::dbgs ()
1618
1617
<< " Found mark must check [nocopy] use of escaping box: " << *user);
1619
- diagnosticEmitter.emitAddressEscapingClosureCaptureLoadedAndConsumed (markedValue);
1620
- emittedEarlyDiagnostic = true ;
1618
+ diagnosticEmitter.emitAddressEscapingClosureCaptureLoadedAndConsumed (
1619
+ markedValue) ;
1621
1620
return true ;
1622
1621
}
1623
1622
LLVM_DEBUG (llvm::dbgs ()
1624
1623
<< " Found mark must check [nocopy] error: " << *user);
1625
1624
diagnosticEmitter.emitAddressDiagnosticNoCopy (markedValue, copyAddr);
1626
- emittedEarlyDiagnostic = true ;
1627
1625
return true ;
1628
1626
}
1629
1627
@@ -1679,15 +1677,13 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1679
1677
.didEmitCheckerDoesntUnderstandDiagnostic ());
1680
1678
LLVM_DEBUG (llvm::dbgs ()
1681
1679
<< " Failed to perform borrow to destructure transform!\n " );
1682
- emittedEarlyDiagnostic = true ;
1683
1680
return false ;
1684
1681
}
1685
1682
1686
1683
// If we emitted an error diagnostic, do not transform further and instead
1687
1684
// mark that we emitted an early diagnostic and return true.
1688
1685
if (numDiagnostics != moveChecker.diagnosticEmitter .getDiagnosticCount ()) {
1689
1686
LLVM_DEBUG (llvm::dbgs () << " Emitting borrow to destructure error!\n " );
1690
- emittedEarlyDiagnostic = true ;
1691
1687
return true ;
1692
1688
}
1693
1689
@@ -1708,7 +1704,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1708
1704
if (numDiagnostics != moveChecker.diagnosticEmitter .getDiagnosticCount ()) {
1709
1705
LLVM_DEBUG (llvm::dbgs ()
1710
1706
<< " Emitting destructure through deinit error!\n " );
1711
- emittedEarlyDiagnostic = true ;
1712
1707
return true ;
1713
1708
}
1714
1709
@@ -1738,7 +1733,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1738
1733
moveChecker.diagnosticEmitter
1739
1734
.emitAddressEscapingClosureCaptureLoadedAndConsumed (markedValue);
1740
1735
}
1741
- emittedEarlyDiagnostic = true ;
1742
1736
return true ;
1743
1737
}
1744
1738
@@ -1752,7 +1746,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1752
1746
1753
1747
if (checkForExclusivityHazards (li)) {
1754
1748
LLVM_DEBUG (llvm::dbgs () << " Found exclusivity violation?!\n " );
1755
- emittedEarlyDiagnostic = true ;
1756
1749
return true ;
1757
1750
}
1758
1751
@@ -1785,7 +1778,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1785
1778
// succeeded.
1786
1779
// Otherwise, emit the diagnostic.
1787
1780
moveChecker.diagnosticEmitter .emitObjectOwnedDiagnostic (markedValue);
1788
- emittedEarlyDiagnostic = true ;
1789
1781
LLVM_DEBUG (llvm::dbgs () << " Emitted early object level diagnostic.\n " );
1790
1782
return true ;
1791
1783
}
@@ -1794,7 +1786,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1794
1786
LLVM_DEBUG (llvm::dbgs () << " Found potential borrow inst: " << *user);
1795
1787
if (checkForExclusivityHazards (li)) {
1796
1788
LLVM_DEBUG (llvm::dbgs () << " Found exclusivity violation?!\n " );
1797
- emittedEarlyDiagnostic = true ;
1798
1789
return true ;
1799
1790
}
1800
1791
@@ -1843,7 +1834,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
1843
1834
moveChecker.diagnosticEmitter
1844
1835
.emitAddressEscapingClosureCaptureLoadedAndConsumed (markedValue);
1845
1836
}
1846
- emittedEarlyDiagnostic = true ;
1847
1837
return true ;
1848
1838
}
1849
1839
0 commit comments