aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/X86/X86WinEHState.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-07-08 18:08:52 +0000
committerReid Kleckner <reid@kleckner.net>2015-07-08 18:08:52 +0000
commited012dbf2a6fd7f71e5458ee53fac40ef607df2a (patch)
treedfe26d7534a82b070495ff5d815c30af9fc5ba98 /llvm/lib/Target/X86/X86WinEHState.cpp
parentbc832ed51d3c8bf66acbda978889cd9a8355bd87 (diff)
downloadllvm-ed012dbf2a6fd7f71e5458ee53fac40ef607df2a.zip
llvm-ed012dbf2a6fd7f71e5458ee53fac40ef607df2a.tar.gz
llvm-ed012dbf2a6fd7f71e5458ee53fac40ef607df2a.tar.bz2
[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/Target/X86/X86WinEHState.cpp')
-rw-r--r--llvm/lib/Target/X86/X86WinEHState.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86WinEHState.cpp b/llvm/lib/Target/X86/X86WinEHState.cpp
index 0b88d7a..3a8bcaa 100644
--- a/llvm/lib/Target/X86/X86WinEHState.cpp
+++ b/llvm/lib/Target/X86/X86WinEHState.cpp
@@ -520,6 +520,11 @@ void WinEHStatePass::addSEHStateStores(Function &F, MachineModuleInfo &MMI) {
for (auto &Handler : ActionList) {
if (auto *CH = dyn_cast<CatchHandler>(Handler.get())) {
auto *BA = cast<BlockAddress>(CH->getHandlerBlockOrFunc());
+#ifndef NDEBUG
+ for (BasicBlock *Pred : predecessors(BA->getBasicBlock()))
+ assert(Pred->isLandingPad() &&
+ "WinEHPrepare failed to split block");
+#endif
ExceptBlocks.insert(BA->getBasicBlock());
}
}