This is an archive of the discontinued LLVM Phabricator instance.

[coroutines] Make sure auto return type of await_resume is properly handled
ClosedPublic

Authored by GorNishanov on Sep 4 2017, 5:09 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

GorNishanov created this revision.Sep 4 2017, 5:09 PM
rsmith added inline comments.Sep 4 2017, 5:49 PM
lib/Sema/SemaCoroutine.cpp
451 ↗(On Diff #113798)

Don't desugar the type; instead, use AdjRetType->isBooleanType() || AdjRetType->isVoidType() here. You can also delete the getUnqualifiedType() call above if you do this, and just use RetType here, since ->isBooleanType() on const bool returns true.

GorNishanov retitled this revision from [coroutines] desugar auto type of await_resume before checking whether it is void or bool to [coroutines] Make sure auto return type of await_resume is properly handled.

use isVoidType() and isBooleantType() instead of cruft that used to be there before

GorNishanov marked an inline comment as done.Sep 4 2017, 8:57 PM
GorNishanov added inline comments.
lib/Sema/SemaCoroutine.cpp
451 ↗(On Diff #113798)

Cool! Much shorter and prettier. Thank you!

javed.absar added inline comments.
test/SemaCXX/coroutines.cpp
169 ↗(On Diff #113800)

maybe change the comment to something more meaningful, or remove it.

rsmith accepted this revision.Sep 5 2017, 10:34 AM
This revision is now accepted and ready to land.Sep 5 2017, 10:34 AM
GorNishanov marked an inline comment as done.Sep 5 2017, 11:42 AM
GorNishanov added inline comments.
test/SemaCXX/coroutines.cpp
169 ↗(On Diff #113800)

Sure thing. I'll remove the comment.

This revision was automatically updated to reflect the committed changes.