This patch adds code to outline the catch handlers for Windows C++ exception handling support.
These changes are obviously derived from my earlier patch D6556, but since the direction has changed (from SEH to C++EH) it seemed reasonable to start a new differential.
The test cases are based on clang-generated IR for the listed code using an x86_64-pc-linux target, but I have edited this IR to match expected windows-msvc output.
I edited the IR to remove redundant store and load of the EH object and to replace invokes within a catch block with equivalent calls if the unwind destination does nothing but resume. I have code to perform both of these transformations, but I am holding it back for a later review.
The following things are not yet implemented:
Intrinsic support for llvm.eh.begincatch/llvm.eh.endcatch
Removal of outlined catch handlers.
Use of frame variables within a catch block.
Removal (from the parent function) of frame variables which are only used in catch blocks.
Outlining of unwind handlers.
Chained catch handlers (catching an exception from within a catch handler).
Sharing of blocks between several landing pads.
Production of intrinsics to support .xdata table generation.
I think that making the begin/end catch calls intrinsics is the only thing that should block the current patch. I'll submit a separate patch for that shortly.