[PATCH] D31460: [coroutines] Add cleanup for compiler injected objects/allocations in coroutine body

2017-03-31 Thread Gor Nishanov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL299281: [coroutines] Add cleanup for compiler injected objects/allocations in coroutine… (authored by GorNishanov). Changed prior to commit: https://reviews.llvm.org/D31460?vs=93370=93728#toc

[PATCH] D31460: [coroutines] Add cleanup for compiler injected objects/allocations in coroutine body

2017-03-29 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov added inline comments. Comment at: lib/CodeGen/CGCoroutine.cpp:225 + void Emit(CodeGenFunction , Flags) override { +CGF.EmitStmt(Deallocate); + } rnk wrote: > GorNishanov wrote: > > rnk wrote: > > > This will be called twice: once for a normal

[PATCH] D31460: [coroutines] Add cleanup for compiler injected objects/allocations in coroutine body

2017-03-29 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: lib/CodeGen/CGCoroutine.cpp:225 + void Emit(CodeGenFunction , Flags) override { +CGF.EmitStmt(Deallocate); + } GorNishanov wrote: > rnk wrote: > > This will be called twice: once for a normal exit and once for

[PATCH] D31460: [coroutines] Add cleanup for compiler injected objects/allocations in coroutine body

2017-03-29 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov added inline comments. Comment at: lib/CodeGen/CGCoroutine.cpp:225 + void Emit(CodeGenFunction , Flags) override { +CGF.EmitStmt(Deallocate); + } rnk wrote: > This will be called twice: once for a normal exit and once for exceptional > exit.

[PATCH] D31460: [coroutines] Add cleanup for compiler injected objects/allocations in coroutine body

2017-03-29 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. lgtm Comment at: lib/CodeGen/CGCoroutine.cpp:225 + void Emit(CodeGenFunction , Flags) override { +CGF.EmitStmt(Deallocate); + } This will be called twice:

[PATCH] D31460: [coroutines] Add cleanup for compiler injected objects/allocations in coroutine body

2017-03-29 Thread Gor Nishanov via Phabricator via cfe-commits
GorNishanov created this revision. - Use pushCleanup to emit freeing coroutine memory on normal and EH exits. - Surround emitted code with CodeGenFunction::RunCleanupsScope. https://reviews.llvm.org/D31460 Files: lib/CodeGen/CGCoroutine.cpp test/CodeGenCoroutines/coro-cleanup.cpp