Commit Graph

6 Commits

Author SHA1 Message Date
John McCall
0d4e0a961d Fix the writeback-conflict diagnostic to look through access markers.
We're now double-diagnosing some things that are caught by both
SILGen and static enforcement; we can fix that later, but I want to
unblock this problem first.
2017-04-24 02:02:47 -04:00
Devin Coughlin
9cdff5fe00 [Exclusivity] Improve static enforcement diagnostics
Static diagnostics now refer to the identifier for the variable requiring
exclusive diagnostics. Additionally, when two accesses conflict we now always
emit the main diagnostic on the first modifying access and the note on either
the second modifying access or the read.

The diagnostics also now highlight the source range for the expression
beginning the access.
2017-04-23 11:39:25 -07:00
Devin Coughlin
77611e6ef9 [Exclusivity] Add best-effort static checking for class stored properties.
Add a simple, best-effort static check for exclusive access for stored
class properties. For safety these properties must be checked dynamically,
also -- but we'll now diagnose statically if we see an obvious violation.
2017-04-20 14:27:09 -07:00
Devin Coughlin
a51f98e9f8 [Exclusivity] Add a small number of static end-to-end tests.
These encode the most common forms of violation we expect to detect statically.

This is a test-only change.
2017-04-18 18:19:43 -07:00
Devin Coughlin
ae3b13ed2d [Exclusivity] Put suppression for free function swap() behind a flag
And leave suppression off by default for now. We'll use this to evaluate
how often swap() causes exclusivity conflicts to be reported.
2017-04-18 17:21:53 -07:00
Devin Coughlin
8d180f4bdc [SILDiagnostics] Add suppression for swap() to static access enforcement.
Add a SILLocation-based syntactic suppression for diagnostics of static
access conflicts on the arguments to the Standard Library's swap() free
function. We'll suppress for calls to this function until we have a safe
replacement.
2017-04-15 14:00:38 -07:00