Skip to content
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
27 changes: 5 additions & 22 deletions lib/SILOptimizer/Mandatory/SendNonSendable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,6 @@ class UseAfterSendDiagnosticEmitter {
ApplyIsolationCrossing isolationCrossing) {
// Emit the short error.
diagnoseError(loc, diag::regionbasedisolation_named_send_yields_race, name)
.highlight(loc.getSourceRange())
.limitBehaviorIf(getBehaviorLimit());

// Then emit the note with greater context.
Expand Down Expand Up @@ -928,7 +927,6 @@ class UseAfterSendDiagnosticEmitter {
const ValueDecl *callee) {
// Emit the short error.
diagnoseError(loc, diag::regionbasedisolation_named_send_yields_race, name)
.highlight(loc.getSourceRange())
.limitBehaviorIf(getBehaviorLimit());

// Then emit the note with greater context.
Expand All @@ -953,7 +951,6 @@ class UseAfterSendDiagnosticEmitter {
Identifier name) {
// Emit the short error.
diagnoseError(loc, diag::regionbasedisolation_named_send_yields_race, name)
.highlight(loc.getSourceRange())
.limitBehaviorIf(getBehaviorLimit());

diagnoseNote(
Expand All @@ -965,7 +962,6 @@ class UseAfterSendDiagnosticEmitter {
ApplyIsolationCrossing isolationCrossing) {
diagnoseError(loc, diag::regionbasedisolation_type_send_yields_race,
inferredType)
.highlight(loc.getSourceRange())
.limitBehaviorIf(getBehaviorLimit());

auto calleeIsolationStr =
Expand All @@ -989,14 +985,12 @@ class UseAfterSendDiagnosticEmitter {
void emitNamedUseofStronglySentValue(SILLocation loc, Identifier name) {
// Emit the short error.
diagnoseError(loc, diag::regionbasedisolation_named_send_yields_race, name)
.highlight(loc.getSourceRange())
.limitBehaviorIf(getBehaviorLimit());

// Then emit the note with greater context.
diagnoseNote(
loc, diag::regionbasedisolation_named_value_used_after_explicit_sending,
name)
.highlight(loc.getSourceRange());
name);

// Finally the require points.
emitRequireInstDiagnostics();
Expand All @@ -1005,7 +999,6 @@ class UseAfterSendDiagnosticEmitter {
void emitTypedUseOfStronglySentValue(SILLocation loc, Type inferredType) {
diagnoseError(loc, diag::regionbasedisolation_type_send_yields_race,
inferredType)
.highlight(loc.getSourceRange())
.limitBehaviorIf(getBehaviorLimit());
if (auto callee = getSendingCallee()) {
diagnoseNote(loc,
Expand All @@ -1024,7 +1017,6 @@ class UseAfterSendDiagnosticEmitter {
ApplyIsolationCrossing isolationCrossing) {
// Emit the short error.
diagnoseError(loc, diag::regionbasedisolation_named_send_yields_race, name)
.highlight(loc.getSourceRange())
.limitBehaviorIf(getBehaviorLimit());

auto descriptiveKindStr =
Expand All @@ -1039,8 +1031,7 @@ class UseAfterSendDiagnosticEmitter {
diagnoseNote(loc,
diag::regionbasedisolation_named_isolated_closure_yields_race,
isDisconnected, descriptiveKindStr, name, calleeIsolationStr,
callerIsolationStr)
.highlight(loc.getSourceRange());
callerIsolationStr);
emitRequireInstDiagnostics();
}

Expand All @@ -1049,7 +1040,6 @@ class UseAfterSendDiagnosticEmitter {
ApplyIsolationCrossing isolationCrossing) {
diagnoseError(loc, diag::regionbasedisolation_type_send_yields_race,
inferredType)
.highlight(loc.getSourceRange())
.limitBehaviorIf(getBehaviorLimit());

auto calleeIsolationStr =
Expand Down Expand Up @@ -1125,14 +1115,12 @@ class UseAfterSendDiagnosticEmitter {
auto require = requireInsts.pop_back_val();
switch (require.getKind()) {
case RequireInst::UseAfterSend:
diagnoseNote(*require, diag::regionbasedisolation_maybe_race)
.highlight(require->getLoc().getSourceRange());
diagnoseNote(*require, diag::regionbasedisolation_maybe_race);
continue;
case RequireInst::InOutReinitializationNeeded:
diagnoseNote(
*require,
diag::regionbasedisolation_inout_sending_must_be_reinitialized)
.highlight(require->getLoc().getSourceRange());
diag::regionbasedisolation_inout_sending_must_be_reinitialized);
continue;
}
llvm_unreachable("Covered switch isn't covered?!");
Expand Down Expand Up @@ -1598,7 +1586,6 @@ class SendNeverSentDiagnosticEmitter {
ApplyIsolationCrossing crossing) {
diagnoseError(loc, diag::regionbasedisolation_type_send_yields_race,
inferredType)
.highlight(loc.getSourceRange())
.limitBehaviorIf(getBehaviorLimit());

auto descriptiveKindStr =
Expand Down Expand Up @@ -1635,15 +1622,13 @@ class SendNeverSentDiagnosticEmitter {
diagnoseNote(loc,
diag::regionbasedisolation_named_isolated_closure_yields_race,
isDisconnected, descriptiveKindStr, name, calleeIsolationStr,
callerIsolationStr)
.highlight(loc.getSourceRange());
callerIsolationStr);
}

void emitTypedSendingNeverSendableToSendingParam(SILLocation loc,
Type inferredType) {
diagnoseError(loc, diag::regionbasedisolation_type_send_yields_race,
inferredType)
.highlight(loc.getSourceRange())
.limitBehaviorIf(getBehaviorLimit());

auto descriptiveKindStr =
Expand Down Expand Up @@ -1742,7 +1727,6 @@ class SendNeverSentDiagnosticEmitter {
diagnoseError(loc,
diag::regionbasedisolation_typed_tns_passed_sending_closure,
descriptiveKindStr)
.highlight(loc.getSourceRange())
.limitBehaviorIf(behaviorLimit);
};

Expand Down Expand Up @@ -1798,7 +1782,6 @@ class SendNeverSentDiagnosticEmitter {

void emitNamedOnlyError(SILLocation loc, Identifier name) {
diagnoseError(loc, diag::regionbasedisolation_named_send_yields_race, name)
.highlight(getOperand()->getUser()->getLoc().getSourceRange())
.limitBehaviorIf(getBehaviorLimit());
}

Expand Down