Skip to content

Commit e811193

Browse files
author
Joshua Turcotti
authored
Merge pull request #67172 from JTurcotti/sil-pass
Add SIL Pass for flow-sensitive, region-based Sendable checking
2 parents 2b13365 + e7a1747 commit e811193

File tree

9 files changed

+1748
-87
lines changed

9 files changed

+1748
-87
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,5 +856,12 @@ NOTE(sil_referencebinding_inout_binding_here, none,
856856
"inout binding here",
857857
())
858858

859+
// Warnings arising from the flow-sensitive checking of Sendability of
860+
// non-Sendable values
861+
WARNING(consumed_value_used, none,
862+
"Non-Sendable value consumed, then used at this site; could yield race with another thread", ())
863+
WARNING(arg_region_consumed, none,
864+
"This application could pass `self` or a Non-Sendable argument of this function to another thread, potentially yielding a race with the caller", ())
865+
859866
#define UNDEFINE_DIAGNOSTIC_MACROS
860867
#include "DefineDiagnosticMacros.h"

include/swift/AST/Expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4649,7 +4649,7 @@ struct ApplyIsolationCrossing {
46494649

46504650
// Whether to use the isolation of the caller or callee for generating
46514651
// informative diagnostics depends on whether this crossing is an exit.
4652-
// In particular, we tend to use the caller isolation for diagnostics,
4652+
// In particular, we tend to use the callee isolation for diagnostics,
46534653
// but if this crossing is an exit from isolation then the callee isolation
46544654
// is not very informative, so we use the caller isolation instead.
46554655
ActorIsolation getDiagnoseIsolation() const {

0 commit comments

Comments
 (0)