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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits