lxfind added inline comments.
================ Comment at: clang/lib/CodeGen/CGCoroutine.cpp:221 CGF.EmitBlock(RealSuspendBlock); + } else if (ForcestackStart) { + Builder.CreateCall( ---------------- ChuanqiXu wrote: > ChuanqiXu wrote: > > can we rewrite it into: > > ``` > > else if (SuspendRet != nullptr && SuspendRet->getType()->isClassType()) { > > // generate: > > // llvm.coro.forcestack(SuspendRet) > > } > > ``` > Sorry I find we can't did it directly. As you said, we need to traverse down > SuspendRet. And I still think we should did it only at CodeGen part since it > looks not so hard. I guess we could make it in above 10~15 lines of codes. Traversing down AST isn't the hard part. The hard part is to search the emitted IR, and look for the temporary alloca used to store the returned handle. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98638/new/ https://reviews.llvm.org/D98638 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits