Skip to content

Commit ce9cefc

Browse files
committed
expand comment
1 parent 52a918e commit ce9cefc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clang/lib/CodeGen/CGCoroutine.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,11 @@ void CodeGenFunction::EmitCoroutineBody(const CoroutineBodyStmt &S) {
857857
// parameter copies.
858858
for (const ParmVarDecl *Parm : FnArgs) {
859859
// If the original param is in an alloca, exclude it from the coroutine
860-
// frame. The parameter copy will be part of the frame.
860+
// frame. The parameter copy will be part of the frame, but the original
861+
// parameter memory should remain on the stack. This is necessary to
862+
// ensure that parameters destroyed in callees, as with `trivial_abi` or
863+
// in the MSVC C++ ABI, are appropriately destroyed after setting up the
864+
// coroutine.
861865
Address ParmAddr = GetAddrOfLocalVar(Parm);
862866
if (auto *ParmAlloca =
863867
dyn_cast<llvm::AllocaInst>(ParmAddr.getBasePointer())) {

0 commit comments

Comments
 (0)