Skip to content

[Async CC] Unroll workaround where @main was async. #34750

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

nate-chandler
Copy link
Contributor

As part of concurrency bringup, some workarounds were put in place to enable the async cc execution tests to continue to run while enabling async function SIL verification (specifically, that an async function must be called from an async function) to land before we have the Task.runDetached mechanism. Specifically, these workaround allow @main to be annotated @async but continue to be emitted as if it were not @async.

Now that we have a better mechanism in the form of runAsync, use that instead.

rdar://problem/70597390

Metadata for an instance of a type is resolved by extracting it from an
instance of the class.  When doing method lookup for an instance method
of a resilient class, the lowered self value was being obtained from the
list of arguments directly by indexing.  That does not apply to async
functions where self is embedded within the async context.  Here, the
self parameter is extracted from the async context so that the metadata
can in turn be extracted from it.

rdar://problem/71260862
As part of concurrency bringup, some workarounds were put in place to
enable the async cc execution tests to continue to run while enabling
async function SIL verification (specifically, that an async function
must be called from an async function) to land before we have the
Task.runDetached mechanism.  Specifically, these workaround allow @main
to be annotated @async but continue to be emitted as if it were not
@async.

Now that we have a better mechanism in the form of runAsync, use that
instead.

rdar://problem/70597390
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@DougGregor
Copy link
Member

So the goal here is to switch to runAsync now, then Task.runDetached once we have that up and running?

@DougGregor DougGregor merged commit c2b3be4 into swiftlang:main Nov 15, 2020
@nate-chandler
Copy link
Contributor Author

@DougGregor Exactly.

@nate-chandler nate-chandler deleted the concurrency/irgen/rdar70597390 branch July 5, 2023 23:30
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.

2 participants