================
@@ -855,6 +855,16 @@ void CodeGenFunction::EmitCoroutineBody(const 
CoroutineBodyStmt &S) {
     // Create parameter copies. We do it before creating a promise, since an
     // evolution of coroutine TS may allow promise constructor to observe
     // parameter copies.
+    for (const ParmVarDecl *Parm : FnArgs) {
+      // If the original param is in an alloca, exclude it from the coroutine
+      // frame. The parameter copy will be part of the frame.
----------------
rnk wrote:

Please elaborate in this comment:
```
// frame. The parameter copy will be part of the frame. The parameter copy 
// will live on the heap, but the original parameter memory should remain on
// the stack. This is necessary to ensure that parameters destroyed in callees, 
as
// with `trivial_abi` or in the MSVC C++ ABI, are appropriately destroyed after
// setting up the coroutine.
```

https://github.com/llvm/llvm-project/pull/127653
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to