forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 30
[pull] swiftwasm from main #1875
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In swiftlang/llvm-project#1860, the diagnostic for a missing import in an umbrella header was improved by moving it to the end of the file and including a fix-it suggesting the import that would be needed. This breaks two things on the Swift side: • One Swift test assumes the old source location will be used. • The `ClangSourceBufferImporter` doesn’t work correctly when a diagnostic is emitted at EOF. It tries to create a virtual file covering EOF..<EOF, but it’s not actually valid to start a virtual file at EOF—it would always be empty. This commit corrects these issues, which should unblock the automerger. Fixes rdar://69707827.
…form. Introduce a new Actor protocol, which is a class-bound protocol with only one requirement: func enqueue(partialTask: PartialAsyncTask) All actor classes implicitly conform to this protocol, and will synthesize a (currently empty) definition of `enqueue(partialTask:)` unless a suitable one is provided explicitly.
When an actor class has its `enqueue(partialTask:)` implicitly synthesized, also synthesize a stored property for the actor's queue. The type of the property is defined by the _Concurrency library (`_DefaultActorQueue`), and it will be initialized with a call to `_defaultActorQueueCreate` (also provided by the _Concurrency library). Also synthesize the body of the implicitly-generated `enqueue(partialTask:)`, which will be a call to `_defaultActorQueueEnqueuePartialTask(actor:queue:partialTask:)`. Together, all of these allow us to experiment with the form of the queue and the queue operation without affecting the type checker. When `enqueue(partialTask:)` is not implicitly synthesized, the queue storage is not synthesized either. In such cases, the user has taken over the execution of tasks for the actor, rather than using the default implementation.
…d an ossa test case.
…bles. Actor classes never have non-actor superclasses, so we can ensure that all actor classes have a common vtable prefix for the `enqueue(partialTask:)` operation. This allows us to treat all actor classes uniformly, without having to go through the Actor witness table every time.
…minator. For actor class's implementations of `enqueue(partialTask:)`, use a fixed ptrauth discriminator. Paired with the fixed vtable location, this allows one to invoke this operation on any native actor instance without knowing the specific type.
Actor-isolated operations must not be directly accessible from anywhere that is not already guaranteed to be running within the actor context. Prevent such operations from being `@objc`, because that would allow Objective-C code to violate actor isolation.
NSObject is guaranteed to have no state and no Swift vtable, and is necessary for Swift classes to implement the NSObject protocol. Allow it (and only it) as the superclass of an actor class, so that actor classes can be exposed to Objective-C.
When eliminating an enum from an alloc_stack, accept "dead" inject_enum_addr instructions, which inject different enum cases.
…ons. If the branch-block injects a certain enum case and the destination switches on that enum, it's worth jump threading. E.g. inject_enum_addr %enum : $*Optional<T>, #Optional.some ... // no memory writes here br DestBB DestBB: ... // no memory writes here switch_enum_addr %enum : $*Optional<T>, case #Optional.some ... This enables removing all code with optionals in a loop, which iterates over an array of address-only elements, e.g. func test<T>(_ items: [T]) { for i in items { print(i) } }
…leanup AST: Move GenericParamList and friends to GenericParamList.{h,cpp}
…ention-demangling [Demangler] Print convention attributes consistently.
…483b31000e466a446562218 [ownership] Move ownership passed TempLValueOpt for the stdlib and add an ossa test case.
SILOptimizer: two optimization improvements for address-only enums
…6bd205dea831f31264dfbc7
…lla-corporation [ClangImporter] Update umbrella header diagnostic handling
…protocol [Concurrency] Introduce Actor protocol to which actor classes all conform
…5e3ad4de714847cf43d0439 [ownership] Move ownership elimination on the stdlib passed lower aggregate instrs.
I already updated SROA for this and we already have tests/etc. We have just been waiting on some other passes to be moved afterwards.
…0993211cdbc57fd7024a93e [ownership] Move ownership lowering past SROA.
MaxDesiatov
approved these changes
Oct 1, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]. Want to support this open source service? Please star it : )