Skip to content

Conversation

@atrick
Copy link
Contributor

@atrick atrick commented May 10, 2018

It turns out that it's necessary to special case exclusivity Builtins and add flags to SIL instructions because of a couple circumstances:

  • Swift 3 mode exclusivity warnings will continue to be warnings.
  • The standard library will continue building in Swift 3 mode (for the foreseeable future).

atrick added 3 commits May 9, 2018 21:42
This flag supports promoting KeyPath access violations to an error in
Swift 4+, while building the standard library in Swift 3 mode. This is
only necessary as long as the standard library continues to build in
Swift 3 mode. Once the standard library build migrates, it can all be
ripped out.

<rdar://problem/40115738> [Exclusivity] Enforce Keypath access as an error, not a warning in 4.2.
Modify IRGen to emit builtin access markers with an error flag in
Swift 3 mode.

KeyPath enforcement is required by user code in Swift 4+ mode, but is
implemented within the standard library. A [builtin] flag marks the
special case for access generated by Builtins so that they are
always enforced as an error regardless of the language mode.

This is necessary for Swift 4.2 because the standard library continues
to build in Swift 3 mode. Once the standard library build migrates,
this is all irrelevant.

This does not actually affect existing Swift 3 code, since the KeyPath
feature wasn't introduced until Swift 4.

<rdar://problem/40115738> [Exclusivity] Enforce Keypath access as an error, not a warning in 4.2.
@atrick
Copy link
Contributor Author

atrick commented May 10, 2018

In case some tooling needs the radar number in the PR instead of the commit log:
rdar://40115738 [Exclusivity] Enforce Keypath access as an error, not a warning in 4.2.

@atrick atrick requested a review from gottesmm May 10, 2018 06:27
@atrick
Copy link
Contributor Author

atrick commented May 10, 2018

@swift-ci test.

@atrick
Copy link
Contributor Author

atrick commented May 10, 2018

@swift-ci test source compatibility.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e8c65b3

I noticed this during testing, but it has nothing to do with the other changes
in this PR. This static violation has always been present as a warning and would
continue to be a warning after my changes.
@atrick
Copy link
Contributor Author

atrick commented May 10, 2018

I don't think the two stdlib validation test timeouts are related to these changes. Both tests pass quickly in my local build.

@atrick
Copy link
Contributor Author

atrick commented May 10, 2018

@swift-ci test.

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e8c65b3

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e8c65b3

@atrick atrick merged commit 6a48b2d into swiftlang:master May 10, 2018
@atrick atrick deleted the enforce-keypath-exclusivity-as-error branch May 22, 2018 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants