[clang] [Clang] CGCoroutines skip emitting try block for value returning `noexcept` init `await_resume` calls (PR #73160)
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 22 21:25:38 PST 2023
================
@@ -129,7 +130,14 @@ static SmallString<32> buildSuspendPrefixStr(CGCoroData &Coro, AwaitKind Kind) {
return Prefix;
}
-static bool memberCallExpressionCanThrow(const Expr *E) {
+static bool ResumeExprCanThrow(const CoroutineSuspendExpr &S) {
+ const Expr *E = S.getResumeExpr();
+
+ // If the return type of await_resume is not void, get the CXXMemberCallExpr
+ // from its subexpr.
+ if (const auto *BindTempExpr = dyn_cast<CXXBindTemporaryExpr>(E)) {
+ E = BindTempExpr->getSubExpr();
+ }
----------------
ChuanqiXu9 wrote:
Such pattern match doesn't smell good. How about looking into its children recursively if we find `E` is not CXXMemberCallExpr?
https://github.com/llvm/llvm-project/pull/73160
More information about the cfe-commits
mailing list