aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorYuxuan Chen <ych@meta.com>2023-11-28 19:04:29 -0800
committerGitHub <noreply@github.com>2023-11-28 19:04:29 -0800
commit4a294b5806417aa88c91aa05735b2d557ea5dfe5 (patch)
tree158bbe34e08c69306dbe8a91e0f4da5f95d36c87 /clang/lib/CodeGen/CodeGenModule.cpp
parent593358937025e8635f75ba8931130b1ca5212ea1 (diff)
downloadllvm-4a294b5806417aa88c91aa05735b2d557ea5dfe5.zip
llvm-4a294b5806417aa88c91aa05735b2d557ea5dfe5.tar.gz
llvm-4a294b5806417aa88c91aa05735b2d557ea5dfe5.tar.bz2
[Clang] CGCoroutines skip emitting try block for value returning `noexcept` init `await_resume` calls (#73160)
Previously we were not properly skipping the generation of the `try { }` block around the `init_suspend.await_resume()` if the `await_resume` is not returning void. The reason being that the resume expression was wrapped in a `CXXBindTemporaryExpr` and the first dyn_cast failed, silently ignoring the noexcept. This only mattered for `init_suspend` because it had its own try block. This patch changes to first extract the sub expression when we see a `CXXBindTemporaryExpr`. Then perform the same logic to check for `noexcept`. Another version of this patch also wanted to assert the second step by `cast<CXXMemberCallExpr>` and as far as I understand it should be a valid assumption. I can change to that if upstream prefers.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions