diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-07-08 18:08:52 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-07-08 18:08:52 +0000 |
commit | ed012dbf2a6fd7f71e5458ee53fac40ef607df2a (patch) | |
tree | dfe26d7534a82b070495ff5d815c30af9fc5ba98 /llvm/lib/CodeGen | |
parent | bc832ed51d3c8bf66acbda978889cd9a8355bd87 (diff) | |
download | bcm5719-llvm-ed012dbf2a6fd7f71e5458ee53fac40ef607df2a.tar.gz bcm5719-llvm-ed012dbf2a6fd7f71e5458ee53fac40ef607df2a.zip |
[SEH] Ensure that empty __except blocks have their own BB
The 32-bit lowering assumed that WinEHPrepare had this invariant.
WinEHPrepare did it for C++, but not SEH. The result was that we would
insert calls to llvm.x86.seh.restoreframe in normal basic blocks, which
corrupted the frame pointer.
llvm-svn: 241699
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/WinEHPrepare.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp index 0f84ba0a723..62ef1d4ae57 100644 --- a/llvm/lib/CodeGen/WinEHPrepare.cpp +++ b/llvm/lib/CodeGen/WinEHPrepare.cpp @@ -533,9 +533,9 @@ void WinEHPrepare::findSEHEHReturnPoints( BasicBlock *NextBB; Constant *Selector; if (isSelectorDispatch(BB, CatchHandler, Selector, NextBB)) { - // Split the edge if there is a phi node. Returning from EH to a phi node - // is just as impossible as having a phi after an indirectbr. - if (isa<PHINode>(CatchHandler->begin())) { + // Split the edge if there are multiple predecessors. This creates a place + // where we can insert EH recovery code. + if (!CatchHandler->getSinglePredecessor()) { DEBUG(dbgs() << "splitting EH return edge from " << BB->getName() << " to " << CatchHandler->getName() << '\n'); BBI = CatchHandler = SplitCriticalEdge( |