This is an archive of the discontinued LLVM Phabricator instance.

[coroutines] Fix re-building of dependent coroutine promise_type
AbandonedPublic

Authored by EricWF on Oct 6 2016, 12:07 AM.

Details

Summary

When using TreeTransform to rebuild a coroutine the coroutine promise_type variable is not transformed because it's stored in the FunctionScopeInfo and not as a regular sub-statement of the function.

This patch attempts to fix this by rebuilding the promise variable at the start of transforming a CoroutineBodyStmt. Additionally this patch changes TransformCoroutineBodyStmt so that it always re-builds the coroutine body. Is there a better alternative to always rebuilding the body? Or is always rebuilding sufficient for now?

Note: This patch also moves the location of some diagnostics from the location of a co_foo keyword to the function declaration.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 73729.Oct 6 2016, 12:07 AM
EricWF retitled this revision from to [coroutines] Fix re-building of dependent coroutine promise_type.
EricWF updated this object.
EricWF added reviewers: rsmith, GorNishanov, majnemer.
EricWF added a subscriber: cfe-commits.
EricWF updated this object.Oct 6 2016, 12:09 AM
EricWF abandoned this revision.Oct 6 2016, 2:42 AM

This is all wrong. Sorry for the noise.