Skip to content

[move-only] Eliminate dead field. #65892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions lib/SILOptimizer/Mandatory/MoveOnlyAddressCheckerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,6 @@ struct GatherUsesVisitor final : public TransitiveAddressWalker {
MoveOnlyAddressCheckerPImpl &moveChecker;
UseState &useState;
MarkMustCheckInst *markedValue;
bool emittedEarlyDiagnostic = false;
DiagnosticEmitter &diagnosticEmitter;

// Pruned liveness used to validate that load [take]/load [copy] can be
Expand Down Expand Up @@ -1529,14 +1528,13 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
if (isa<ProjectBoxInst>(stripAccessMarkers(markedValue->getOperand()))) {
LLVM_DEBUG(llvm::dbgs()
<< "Found mark must check [nocopy] use of escaping box: " << *user);
diagnosticEmitter.emitAddressEscapingClosureCaptureLoadedAndConsumed(markedValue);
emittedEarlyDiagnostic = true;
diagnosticEmitter.emitAddressEscapingClosureCaptureLoadedAndConsumed(
markedValue);
return true;
}
LLVM_DEBUG(llvm::dbgs()
<< "Found mark must check [nocopy] error: " << *user);
diagnosticEmitter.emitAddressDiagnosticNoCopy(markedValue, copyAddr);
emittedEarlyDiagnostic = true;
return true;
}

Expand Down Expand Up @@ -1592,15 +1590,13 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
.didEmitCheckerDoesntUnderstandDiagnostic());
LLVM_DEBUG(llvm::dbgs()
<< "Failed to perform borrow to destructure transform!\n");
emittedEarlyDiagnostic = true;
return false;
}

// If we emitted an error diagnostic, do not transform further and instead
// mark that we emitted an early diagnostic and return true.
if (numDiagnostics != moveChecker.diagnosticEmitter.getDiagnosticCount()) {
LLVM_DEBUG(llvm::dbgs() << "Emitting borrow to destructure error!\n");
emittedEarlyDiagnostic = true;
return true;
}

Expand All @@ -1621,7 +1617,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
if (numDiagnostics != moveChecker.diagnosticEmitter.getDiagnosticCount()) {
LLVM_DEBUG(llvm::dbgs()
<< "Emitting destructure through deinit error!\n");
emittedEarlyDiagnostic = true;
return true;
}

Expand All @@ -1646,7 +1641,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
moveChecker.diagnosticEmitter
.emitAddressEscapingClosureCaptureLoadedAndConsumed(markedValue);
}
emittedEarlyDiagnostic = true;
return true;
}

Expand All @@ -1660,7 +1654,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {

if (checkForExclusivityHazards(li)) {
LLVM_DEBUG(llvm::dbgs() << "Found exclusivity violation?!\n");
emittedEarlyDiagnostic = true;
return true;
}

Expand Down Expand Up @@ -1693,7 +1686,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
// succeeded.
// Otherwise, emit the diagnostic.
moveChecker.diagnosticEmitter.emitObjectOwnedDiagnostic(markedValue);
emittedEarlyDiagnostic = true;
LLVM_DEBUG(llvm::dbgs() << "Emitted early object level diagnostic.\n");
return true;
}
Expand All @@ -1702,7 +1694,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
LLVM_DEBUG(llvm::dbgs() << "Found potential borrow inst: " << *user);
if (checkForExclusivityHazards(li)) {
LLVM_DEBUG(llvm::dbgs() << "Found exclusivity violation?!\n");
emittedEarlyDiagnostic = true;
return true;
}

Expand Down Expand Up @@ -1751,7 +1742,6 @@ bool GatherUsesVisitor::visitUse(Operand *op) {
moveChecker.diagnosticEmitter
.emitAddressEscapingClosureCaptureLoadedAndConsumed(markedValue);
}
emittedEarlyDiagnostic = true;
return true;
}

Expand Down