[WinEH] Avoid creating MBBs for LLVM BBs that cannot contain code
authorReid Kleckner <rnk@google.com>
Tue, 8 Sep 2015 23:28:38 +0000 (23:28 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 8 Sep 2015 23:28:38 +0000 (23:28 +0000)
commit18329ced975b85fbcf34aaa928e5d66fe8da8282
treea7a832f2a4904dd54c3b0f848e17aad6f833c456
parent9e5511adf8e572cfc4250a110aeb91efb5197c01
[WinEH] Avoid creating MBBs for LLVM BBs that cannot contain code

Typically these are catchpads, which hold data used to decide whether to
catch the exception or continue unwinding. We also shouldn't create MBBs
for catchendpads, cleanupendpads, or terminatepads, since no real code
can live in them.

This fixes a problem where MI passes (like the register allocator) would
try to put code into catchpad blocks, which are not executed by the
runtime. In the new world, blocks ending in invokes now have many
possible successors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247102 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/CodeGen/SelectionDAG/StatepointLowering.cpp
test/CodeGen/X86/win-catchpad.ll