EHTerminateScope is used to implement C++ noexcept semantics, and per
C++ [except.terminate], it is implemented-defined whether no, some, or
all cleanups are run prior to terminate.
We now define the behavior as "some" -- cleanups in nested function
calls will still be run, but not those in the noexcept function
itself.
Does the situation where both IsEHCleanup and IsNormalCleanup end up set to false work well? (Eg, do we avoid generating cleanup code entirely, even for things like conditional cleanups where we might otherwise generate a condition variable?) Eg, in a case like this:
... we currently inject some i1s to track whether each A is alive, and could presumably omit them here.
If this patch isn't enough to handle that, maybe this isn't worth worrying about at this level and we can just let the optimizer remove them again?