This is an archive of the discontinued LLVM Phabricator instance.

[coroutines] Allow co_await and co_yield expressions that return an lvalue to compile
ClosedPublic

Authored by EricWF on Jun 13 2017, 10:55 PM.

Diff Detail

Event Timeline

EricWF created this revision.Jun 13 2017, 10:55 PM
EricWF updated this revision to Diff 102485.Jun 13 2017, 11:35 PM
EricWF edited the summary of this revision. (Show Details)
  • Fix assertion for co_yield.
EricWF updated this revision to Diff 102486.Jun 13 2017, 11:37 PM
  • Remove unneeded assertion.
EricWF updated this revision to Diff 102487.Jun 13 2017, 11:38 PM
  • Improve tests
EricWF updated this revision to Diff 102492.Jun 13 2017, 11:56 PM
  • Improve test by using regular expressions and [[Name]] where possible.
EricWF updated this revision to Diff 102494.Jun 14 2017, 12:27 AM
GorNishanov accepted this revision.Jun 15 2017, 9:11 AM

LGTM

test/CodeGenCoroutines/coro-await.cpp
301

s/chrash/crash
s/a await_resume/an await_resume/

This revision is now accepted and ready to land.Jun 15 2017, 9:11 AM
GorNishanov requested changes to this revision.Jun 15 2017, 10:12 AM
GorNishanov added inline comments.
lib/CodeGen/CGCoroutine.cpp
255

#ifndef NDEBUG
...
#endif

This revision now requires changes to proceed.Jun 15 2017, 10:12 AM
GorNishanov accepted this revision.Jun 15 2017, 10:12 AM

LGTM with changes

This revision is now accepted and ready to land.Jun 15 2017, 10:12 AM

Added John McCall as he made great suggestions last time I touched emitSuspendExpression

GorNishanov added inline comments.Jun 15 2017, 10:26 AM
test/CodeGenCoroutines/coro-await.cpp
310

In release compiler, labels won't have friendly names. //CHECK: await2.ready will fail

EricWF marked 2 inline comments as done.Jun 15 2017, 11:44 AM
EricWF added inline comments.
test/CodeGenCoroutines/coro-await.cpp
310

I'm not sure I understand. Are you saying that Clang generates different IR depending on how it's built (ie release vs debug)?

EricWF updated this revision to Diff 102701.Jun 15 2017, 11:48 AM
  • Address most inline comments.
EricWF updated this revision to Diff 102705.Jun 15 2017, 12:43 PM
  • Fix the test when -discard-value-names is present, at least my part of the test.
EricWF closed this revision.Jun 15 2017, 12:44 PM