-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CoroutineAccessors] Initial framing. #76526
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
[CoroutineAccessors] Initial framing. #76526
Conversation
467955f
to
7b7a741
Compare
7df685e
to
e37fe1c
Compare
e37fe1c
to
02c06eb
Compare
And replaced direct comparisons with calls to predicates. In preparation for introducing parallel non-underscored accessors.
To the routine that parses the introducer for an accessor whether it is would be first accessor, pass whether it would be the first accessor; from it, return whether the accessor is from an unavailable feature. These both enable expected behavior when an experimental feature is disabled: the former enables maintaining source compatibility with code that uses the introducer name as a function name which is called with a trailing closure as the first expression in an implicit getter. The latter enables suppressing duplicative diagnostics.
It was once used for materializeForSet.
Enable customizing the behavior of macro expansions of for accessors which are experimental coroutines.
Don't bother saving the previous ExcludeAttrList's size and restoring it after execution when that list isn't modified.
And move a couple of StorageImplInfo member functions into it. In preparation for making them use an ASTContext, to avoid importing that header into StorageImpl.h, a lightweight header.
02c06eb
to
30f2c3c
Compare
In preparation to introduce more calls.
Make use of swift::getAccessorNameForDiagnostic instead of having a parallel list of accessor names in DiagnosticsSema.def.
30f2c3c
to
3c1361c
Compare
Refer to the correct problematic accessor or accessors.
The name is a placeholder for the mutating single-yield coroutine accessor.
The name is a placeholder for the mutating single-yield coroutine accessor.
3c1361c
to
091368b
Compare
@swift-ci please test |
@swift-ci please test source compatibility |
@swift-ci please test linux platform |
@@ -7861,7 +7861,9 @@ static bool isAllowedWhenParsingLimitedSyntax(AccessorKind kind, bool forSIL) { | |||
case AccessorKind::WillSet: | |||
case AccessorKind::DidSet: | |||
case AccessorKind::Read: | |||
case AccessorKind::Read2: |
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.
Would it make sense to have more descriptive names here than Read2
? For example, rename the exiting Read
to UnderscoreRead
and then use Read
for Read2
.
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 Read2 and Modify2 are fine placeholders for now until the final names are decided on.
Initial steps towards
read
andmodify
. Add a new feature flag. Behind it, allow parsing the keywords. Add mangling for these symbols. For now, they are emitted just like_read
and_modify
.