[PATCH] D158233: [SEH] Fix wrong argument passes to the call of OutlinedFinally.
Jennifer Yu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 21 16:02:09 PDT 2023
jyu2 added inline comments.
================
Comment at: clang/lib/CodeGen/CGCleanup.cpp:882
if (!Scope.hasBranchThroughs() && !HasFixups && !HasFallthrough &&
- Scope.getNumBranchAfters() == 1) {
+ !getLangOpts().EHAsynch && Scope.getNumBranchAfters() == 1) {
assert(!BranchThroughDest || !IsActive);
----------------
rnk wrote:
> rnk wrote:
> > This seems like it's only necessary when exiting a `__try` scope, but this check affects all exits from C++ cleanup scopes. Is there a way to check if there is an active try scope? When do we need to signal abnormal termination via normal control flow?
> You can consider `usesSEHTry` , but it will require some type checking and casting: https://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html#a275d0f7f778c6ece58722aabde9b6d86
Thanks @rnk! That is good point. I was thinking I just turn off this optimization when EHa is used.
Can I use currentFunctionUsesSEHTry() instead?
Thanks.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D158233/new/
https://reviews.llvm.org/D158233
More information about the cfe-commits
mailing list