]> granicus.if.org Git - clang/commit
[coroutines] Add cleanup for compiler injected objects/allocations in coroutine body
authorGor Nishanov <GorNishanov@gmail.com>
Sat, 1 Apr 2017 00:22:47 +0000 (00:22 +0000)
committerGor Nishanov <GorNishanov@gmail.com>
Sat, 1 Apr 2017 00:22:47 +0000 (00:22 +0000)
commit256dc09899281a446d0eee2c99927ccf864217e5
tree6dc392ad999103edbf7dc2ba400c0cbf7150b547
parent03c6593eccfbbf50bc948d3781e2db0236440c2d
[coroutines] Add cleanup for compiler injected objects/allocations in coroutine body

Summary:
* Use pushCleanup to emit freeing coroutine memory on normal and EH exits.
* Surround emitted code with CodeGenFunction::RunCleanupsScope.

Reviewers: rsmith, rnk, EricWF

Reviewed By: rnk

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D31460

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299281 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCoroutine.cpp
test/CodeGenCoroutines/coro-cleanup.cpp [new file with mode: 0644]
test/CodeGenCoroutines/coro-return.cpp