Skip to content
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

[sending] Add support for 'sending' #73696

Merged
merged 5 commits into from
May 18, 2024
Merged

Conversation

gottesmm
Copy link
Member

This PR adds support to the compiler for 'sending'. It does not completely remove 'transferring' (since it may already be used). Instead what it does is:

  1. Internally except for in the parser and the clang importer, we only represent
    'sending'. This means that it will be easy to remove 'transferring' once enough
    time has passed.

  2. I included a warning that suggested to the user to change 'transferring' ->
    'sending'.

  3. I duplicated the parsing diagnostics for 'sending' so both will still get
    different sets of diagnostics for parsing issues... but anywhere below parsing,
    I have just changed 'transferring' to 'sending' since transferring isn't
    represented at those lower levels.

  4. Since SendingArgsAndResults is always enabled when TransferringArgsAndResults
    is enabled (NOTE not vis-a-versa), we know that we can always parse sending. So
    we import "transferring" as "sending". This means that even if one marks a
    function with "transferring", the compiler will guard it behind a
    SendingArgsAndResults -D flag and in the imported header print out sending.

rdar://128216574

…' instead of 'transferring'.

We still only parse transferring... but this sets us up for adding the new
'sending' syntax by first validating that this internal change does not mess up
the current transferring impl since we want both to keep working for now.

rdar://128216574
…ransferring.

Just trying to slice off a larger change where I change these tests to actually
use 'sending'. This is nice to do now since it is algebraic to do.

rdar://128216574
@gottesmm
Copy link
Member Author

@swift-ci smoke test

A few things:

1. Internally except for in the parser and the clang importer, we only represent
'sending'. This means that it will be easy to remove 'transferring' once enough
time has passed.

2. I included a warning that suggested to the user to change 'transferring' ->
'sending'.

3. I duplicated the parsing diagnostics for 'sending' so both will still get
different sets of diagnostics for parsing issues... but anywhere below parsing,
I have just changed 'transferring' to 'sending' since transferring isn't
represented at those lower levels.

4. Since SendingArgsAndResults is always enabled when TransferringArgsAndResults
is enabled (NOTE not vis-a-versa), we know that we can always parse sending. So
we import "transferring" as "sending". This means that even if one marks a
function with "transferring", the compiler will guard it behind a
SendingArgsAndResults -D flag and in the imported header print out sending.

rdar://128216574
I am doing this after the main transformation to ease commit by commit
understanding of the change.

rdar://128216574
@gottesmm gottesmm force-pushed the rdar128216574 branch 3 times, most recently from 5a1e07b to 3d456ed Compare May 17, 2024 05:12
Copy link
Member

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, when do you think we'll remove transfering - will we be able to drop it in the final 6.0 or may have to tag it along longer? 🤔

Cool thx, when this lands I'll follow up with some changes in distributed

@ahoppen
Copy link
Contributor

ahoppen commented May 17, 2024

I think this also needs a corresponding parser change in swift-syntax.

@gottesmm
Copy link
Member Author

apple/swift-syntax#2658

@swift-ci smoke test

…e SE-0430 an upcoming feature.

I also added support for expressing suppressable upcoming features.

rdar://128216574
@gottesmm
Copy link
Member Author

apple/swift-syntax#2658

@swift-ci smoke test

@gottesmm gottesmm merged commit d759ec9 into apple:main May 18, 2024
3 checks passed
@gottesmm gottesmm deleted the rdar128216574 branch May 18, 2024 09:42
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.

None yet

4 participants