Commit Graph

8 Commits

Author SHA1 Message Date
Devin Coughlin
6dcc8ce9b2 [Exclusivity] Don't suggest copying to a local when swapAt() is appropriate
Update static exclusivity diagnostics to not suggest copying to a local
when a call to swapAt() should be used instead. We already emit a FixIt in
this case, so don't suggest an an helpful fix in the diagnostic.

rdar://problem/32296784
2017-07-16 13:48:52 -07:00
Devin Coughlin
f6df5c79b2 [Exclusivity] Update static diagnostic text for "simultaneous" accesses
Remove the descriptive decl kind (since with subpaths it is not correct and
cannot represent a tuple element) and change "simultaneous" to "overlapping"
in order to lower the register slightly and avoid connoting threading.

For example, for the following:

   takesTwoInouts(&x.f, &x.f)

the diagnostic will change from

"simultaneous accesses to var 'x.f', but modification requires exclusive access;
consider copying to a local variable"

to

"overlapping accesses to 'x.f', but modification requires exclusive access;
consider copying to a local variable"
2017-06-13 20:08:48 -07:00
Andrew Trick
fa70d90b5e [Exclusivity] Update SILGen tests for dynamic access markers. 2017-05-31 21:43:00 -07:00
Devin Coughlin
d54d9b1cfe [SE-0176] Enable static enforcement of exclusive access by default
Turn on static checks for the already-accepted portions of SE-0176: Enforce
Exclusive Access to Memory.

This includes static checking for overlapping inout parameter accesses
(and inout-to-pointer accesses).

Static violations are warnings in Swift 3 compatibility mode and errors
in Swift 4 mode.

Dynamic enforcement is not enabled by default.

This does not add static checking for the Non-Escaping Recursion
Restriction rule nor the Non-Escaping Parameter Call Restriction rule. These
are revisions to SE-0176 still under review.
2017-05-15 10:35:11 -07:00
Max Moiseev
a49dab6bf8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-29 12:08:52 -08:00
Daniel Duan
780b58a9a5 [Parser] update tests for 'inout' syntax adjustment 2016-02-26 01:33:22 -08:00
Maxim Moiseev
0e54467bfa Final bulk removal of Type suffix 2015-12-16 17:06:19 -08:00
Joe Groff
f1b97a1ead SILGen: Admit inout aliasing of polymorphic properties.
A stored property of a class may be overridden by a computed one, and a property requirement may be witnessed by a computed property, but rejecting inout aliasing in these cases isn't very helpful. Only reject cases that are definitely computed and will always behave incorrectly. Fixes rdar://problem/19633414.

Swift SVN r24986
2015-02-05 01:22:02 +00:00