This is an archive of the discontinued LLVM Phabricator instance.

[clang][PR55406] CFG for coroutine
ClosedPublic

Authored by urnathan on May 25 2022, 10:39 AM.

Details

Summary

Here's a minimal fix, without all the cleanup pre-patches.

CoreturnStmt needs to keep the operand value distinct from its use in
any return_value call, so that instantiation may rebuild the latter.
But it also needs to keep the operand value separate in the case of
calling return_void. Code generation checks the operand value form to
determine whether it is a distincte entity to the promise call. This
adds the same logic to CFG generation.

Diff Detail

Event Timeline

urnathan created this revision.May 25 2022, 10:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 10:39 AM
urnathan requested review of this revision.May 25 2022, 10:39 AM
bruno added inline comments.May 25 2022, 11:19 AM
clang/test/SemaCXX/PR55406.cpp
1

Can you rename the test something like thread-safety-coro.cpp? Looks great to me otherwise

urnathan updated this revision to Diff 432094.May 25 2022, 12:52 PM
urnathan updated this revision to Diff 432095.
urnathan marked an inline comment as done.

renamed test case

bruno accepted this revision.May 25 2022, 2:00 PM
This revision is now accepted and ready to land.May 25 2022, 2:00 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2022, 6:41 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript