================ @@ -849,12 +849,30 @@ static bool isAttributedCoroAwaitElidable(const QualType &QT) { return Record && Record->hasAttr<CoroAwaitElidableAttr>(); } -static bool isCoroAwaitElidableCall(Expr *Operand) { - if (!Operand->isPRValue()) { - return false; +static void applySafeElideContext(Expr *Operand) { + auto *Call = dyn_cast<CallExpr>(Operand->IgnoreImplicit()); + if (!Call || !Call->isPRValue()) + return; + + if (!isAttributedCoroAwaitElidable(Call->getType())) + return; + + Call->setCoroElideSafe(); + + // Check parameter + auto *Fn = llvm::dyn_cast_if_present<FunctionDecl>(Call->getCalleeDecl()); + if (!Fn) { + Call->dump(); ---------------- ChuanqiXu9 wrote:
```suggestion ``` https://github.com/llvm/llvm-project/pull/108474 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits