Introduce cleanup scopes for "if" statements in two places:
  - Outside the "if", to ensure that we destroy the condition variable
    at the end of the "if" statement rather than at the end of the
    block containing the "if" statement.
  - Inside the "then" and "else" branches, so that we emit then- or
    else-local cleanups at the end of the corresponding block when the
    block is not a compound statement.

To make adding these new cleanup scopes easier (and since
switch/do/while will all need the same treatment), added the
CleanupScope RAII object to introduce a new cleanup scope and make
sure it gets cleaned up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89773 91177308-0d34-0410-b5e6-96231b3b80d8
3 files changed