[PATCH] D25303: [coroutines] Fix re-building of dependent coroutine promise_type

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 6 00:07:23 PDT 2016


EricWF created this revision.
EricWF added reviewers: rsmith, GorNishanov, majnemer.
EricWF added a subscriber: cfe-commits.
Herald added a subscriber: mehdi_amini.

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?


https://reviews.llvm.org/D25303

Files:
  include/clang/Sema/Sema.h
  lib/Sema/SemaCoroutine.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/TreeTransform.h
  test/SemaCXX/coroutines.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25303.73729.patch
Type: text/x-patch
Size: 14968 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161006/ac79da74/attachment.bin>


More information about the cfe-commits mailing list