diff options
author | Reid Kleckner <rnk@google.com> | 2015-09-08 23:28:38 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2015-09-08 23:28:38 +0000 |
commit | 51189f0a1d0b8b6d1490a4e42df4971916fb9235 (patch) | |
tree | 804c110f1c9172e760631974831c8fd1dd52a950 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | a195adde001abe1b337a4455b8b8c80f340f8a2e (diff) | |
download | bcm5719-llvm-51189f0a1d0b8b6d1490a4e42df4971916fb9235.tar.gz bcm5719-llvm-51189f0a1d0b8b6d1490a4e42df4971916fb9235.zip |
[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.
llvm-svn: 247102
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 7e2bbaef4d8..d4cda5ce1d2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1153,6 +1153,8 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) { BasicBlock::const_iterator BI = End; FuncInfo->MBB = FuncInfo->MBBMap[LLVMBB]; + if (!FuncInfo->MBB) + continue; // Some blocks like catchpads have no code or MBB. FuncInfo->InsertPt = FuncInfo->MBB->getFirstNonPHI(); // Setup an EH landing-pad block. |