[all-commits] [llvm/llvm-project] dce8f2: [Coroutine][Sema] Only tighten the suspend call te...
Xun Li via All-commits
all-commits at lists.llvm.org
Mon Oct 12 12:00:46 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: dce8f2bb25ea1d01533d8e602f2520492fa67259
https://github.com/llvm/llvm-project/commit/dce8f2bb25ea1d01533d8e602f2520492fa67259
Author: Xun Li <xun at fb.com>
Date: 2020-10-12 (Mon, 12 Oct 2020)
Changed paths:
M clang/lib/Sema/SemaCoroutine.cpp
M clang/test/CodeGenCoroutines/coro-semmetric-transfer.cpp
Log Message:
-----------
[Coroutine][Sema] Only tighten the suspend call temp lifetime for final awaiter
In https://reviews.llvm.org/D87470 I added the change to tighten the lifetime of the expression awaiter.await_suspend().address.
Howver it was incorrect. ExprWithCleanups will call the dtor and end the lifetime for all the temps created in the current full expr.
When this is called on a normal await call, we don't want to do that.
We only want to do this for the call on the final_awaiter, to avoid writing into the frame after the frame is destroyed.
This change fixes it, by checking IsImplicit.
Differential Revision: https://reviews.llvm.org/D89066
More information about the All-commits
mailing list