-
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
Updates to @_predatesConcurrency
#40271
Updates to @_predatesConcurrency
#40271
Conversation
|
@swift-ci please build toolchain |
|
Linux Toolchain (Ubuntu 16.04) Install command |
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.
A nit and a question, but this looks good.
| // Imported C declarations always predate concurrency. | ||
| if (isa<ClangModuleUnit>(getDeclContext()->getModuleScopeContext())) | ||
| return true; |
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.
Out of curiosity, what will this match that hasClangNode() wouldn't or vice versa?
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.
IIRC, there's some cases involving synthesized extensions for import-as-member that differ.
| // Strip off Sendable and (possibly) the global actor. | ||
| ASTExtInfo extInfo = | ||
| fnType->hasExtInfo() ? fnType->getExtInfo() : ASTExtInfo(); | ||
| extInfo = extInfo.withConcurrent(false); |
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.
withConcurrent() should probably get renamed eventually, but not today.
| @@ -67,6 +67,9 @@ class ASTMangler : public Mangler { | |||
| /// If enabled, marker protocols can be encoded in the mangled name. | |||
| bool AllowMarkerProtocols = true; | |||
|
|
|||
| /// Whether the mangling predates concurrency, and therefore shouldn't | |||
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.
I think you didn't finish typing this.
|
macOS Toolchain Install command |
…rency decls This allows some APIs to evolve toward supporting concurrency without breaking their ABI.
The `@MainActor(unsafe)` attribute could be provided for C declarations via the Clang `swift_attr` attribute. However, this facility was never used outside of tests, and has been superceded by `@MainActor` with the inferred `@_predatesConcurrency`.
1960e7b
to
42c71c9
Compare
|
@swift-ci please smoke test and merge |
|
@swift-ci please smoke test |
Implement a few remaining pieces of the
@_predatesConcurrencyattribute:@_predatesConcurrencydeclarations to dropSendable,@Sendable, and global actor annotations@_predatesConcurrencyby default