-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove exclusivity support for Swift 3 mode. #19849
Conversation
@swift-ci test. |
@swift-ci test source compatibility. |
Fixes rdar://problem/45146046 Remaining -swift-version 3 tests for exclusivity. |
Build failed |
@swift-ci test. |
@swift-ci test source compatibility. |
Thanks! |
Build failed |
Build failed |
@swift-ci test. |
@swift-ci test source compatibility. |
Build failed |
Build failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Some comments in line.
@@ -13,7 +13,7 @@ public func takesInout(_ i: inout Int) { | |||
func takeClosure(_: ()->Int) {} | |||
|
|||
// Helper taking a basic, no-escape closure. | |||
func takeClosureAndInout(_: inout Int, _: ()->Int) {} | |||
func takeClosureAndInout(_: inout Int, _: @escaping ()->Int) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the comment here is stale since the closure is now escaping.
@@ -570,18 +563,16 @@ static void diagnoseExclusivityViolation(const ConflictingAccess &Violation, | |||
} | |||
|
|||
auto D = | |||
diagnose(Ctx, MainAccess.getAccessLoc().getSourceLoc(), DiagnosticID, | |||
diagnose(Ctx, MainAccess.getAccessLoc().getSourceLoc(), | |||
diag::exclusivity_access_required, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we're only using the non-warning variants it should be safe to delete exclusivity_access_required_warn and f exclusivity_access_required_unknown_decl_warn rom DiagnosticsSIL.def
include/swift/ABI/MetadataValues.h
Outdated
@@ -997,8 +997,10 @@ enum class ExclusivityFlags : uintptr_t { | |||
// Read or Modify). | |||
ActionMask = 0x1, | |||
|
|||
// Downgrade exclusivity failures to a warning. | |||
#ifndef NDEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One possibility to remove the need to expose this in the ABI header is to separate out the unit tests that abort into a separate testing tool (similar to swift-ide-test) and turn the unit tests into file check tests.
Remove the compiler support for exclusivity warnings. Leave runtime support for exclusivity warnings in non-release builds only for unit testing convenience. Remove a test case that checked the warning log output. Modify test cases that relied on successful compilation in the presence of exclusivity violations. Fixes: <rdar://problem/45146046> Remaining -swift-version 3 tests for exclusivity
@devincoughlin @rjmccall I removed the remaining runtime support for warnings and moved the runtime unit tests into a library. |
@swift-ci test. |
Build failed |
Build failed |
@swift-ci test linux platform. |
Build failed |
Create a new RuntimeUnittest library alongside the other stdlib unit tests so we can write C++ runtime unit tests callable from lit. Move runtime exclusivity tests into the stdlib unittest library and create lit tests so we can verify that the runtime crashes with an error message.
@swift-ci test. |
Build failed |
Build failed |
Remove the compiler support for exclusivity warnings.
Leave runtime support for exclusivity warnings in non-release builds
only for unit testing convenience.
Remove a test case that checked the warning log output.
Modify test cases that relied on successful compilation in the
presence of exclusivity violations.