- Use pushCleanup to emit freeing coroutine memory on normal and EH exits.
- Surround emitted code with CodeGenFunction::RunCleanupsScope.
Details
Details
- Reviewers
EricWF rnk rsmith - Commits
- rG63b6df4f05f0: [coroutines] Add cleanup for compiler injected objects/allocations in coroutine…
rC299281: [coroutines] Add cleanup for compiler injected objects/allocations in coroutine…
rL299281: [coroutines] Add cleanup for compiler injected objects/allocations in coroutine…
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
lgtm
lib/CodeGen/CGCoroutine.cpp | ||
---|---|---|
225 ↗ | (On Diff #93370) | This will be called twice: once for a normal exit and once for exceptional exit. In general, double emitting a Stmt* is not safe, since it might contain a VarDecl or a LabelDecl, but this usage is safe because SubStmtBuilder::makeNewAndDeleteExpr() builds two calls that can't declare anything. That is *definitely* worth a comment. :) |
lib/CodeGen/CGCoroutine.cpp | ||
---|---|---|
225 ↗ | (On Diff #93370) | Thank you very much for the review! |
lib/CodeGen/CGCoroutine.cpp | ||
---|---|---|
225 ↗ | (On Diff #93370) | Not really, because gnu statement exprs mean Exprs can contain Decls as well. =( |
lib/CodeGen/CGCoroutine.cpp | ||
---|---|---|
225 ↗ | (On Diff #93370) | Ahh. Okay, comment it is. |