[clang] [clang][CodeGen] Promote point of GRO(CWG2563) (PR #151067)
Weibo He via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 14 18:22:54 PST 2025
================
@@ -973,8 +1028,27 @@ void CodeGenFunction::EmitCoroutineBody(const CoroutineBodyStmt &S) {
// shouldn't change the AST.
if (PreviousRetValue)
cast<ReturnStmt>(Ret)->setRetValue(PreviousRetValue);
- }
+ if (!GroManager.DirectEmit) {
+ // Send GRO conversion to ConvBB
+ auto *ConvBB =
+ cast<llvm::BranchInst>(PreConvBB->getTerminator())->getSuccessor(0);
+ auto FromIt = ++RetBB->getFirstInsertionPt();
+ auto ToIt = RetBB->getTerminator()->getIterator();
+ ConvBB->splice(ConvBB->getFirstNonPHIIt(), RetBB, FromIt, ToIt);
----------------
NewSigma wrote:
Done. In the revision, I sank `coro.end` before splitting around it.
https://github.com/llvm/llvm-project/pull/151067
More information about the cfe-commits
mailing list