================ @@ -5443,24 +5444,38 @@ RValue CodeGenFunction::EmitRValueForField(LValue LV, //===--------------------------------------------------------------------===// RValue CodeGenFunction::EmitCallExpr(const CallExpr *E, - ReturnValueSlot ReturnValue) { + ReturnValueSlot ReturnValue, + llvm::CallBase **CallOrInvoke) { + llvm::CallBase *CallOrInvokeStorage; + if (!CallOrInvoke) { + CallOrInvoke = &CallOrInvokeStorage; + } + + auto AddCoroMustElideOnExit = llvm::make_scope_exit([&] { + if (E->isCoroMustElide()) { + auto *I = *CallOrInvoke; + if (I) + I->addFnAttr(llvm::Attribute::CoroMustElide); ---------------- ChuanqiXu9 wrote:
It looks like all the changes in CodeGen are served for this. And I am a little concerned about if it is worthy to do such a big change for this. @efriedma-quic could you take a look here? And I am wondering if all of the Emit*CallExpr function will be converged to one or a few fundamental functions to emit the CallInst like `EmitCall` then we can do our job there. https://github.com/llvm/llvm-project/pull/99282 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits