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
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
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
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.
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:
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