From 4600c0643466114c20a557b74b233665105cf9bb Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 1 Oct 2015 21:04:13 +0000 Subject: [WinEH] Stop BranchFolding from merging across funclets BranchFolding would merge two funclets together, this is not OK. Disable this and strengthen the assertion in FuncletLayout. llvm-svn: 249069 --- llvm/lib/CodeGen/FuncletLayout.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'llvm/lib/CodeGen/FuncletLayout.cpp') diff --git a/llvm/lib/CodeGen/FuncletLayout.cpp b/llvm/lib/CodeGen/FuncletLayout.cpp index e1e185b4752..4fdb66700b2 100644 --- a/llvm/lib/CodeGen/FuncletLayout.cpp +++ b/llvm/lib/CodeGen/FuncletLayout.cpp @@ -39,17 +39,9 @@ collectFuncletMembers(DenseMap &FuncletMembership, int Funclet, MachineBasicBlock *MBB) { // Don't revisit blocks. if (FuncletMembership.count(MBB) > 0) { - // FIXME: This is a hack, we need to assert this unconditionally. - bool IsProbablyUnreachableBlock = - MBB->empty() || - (MBB->succ_empty() && !MBB->getFirstTerminator()->isReturn() && - MBB->size() == 1); - - if (!IsProbablyUnreachableBlock) { - if (FuncletMembership[MBB] != Funclet) { - assert(false && "MBB is part of two funclets!"); - report_fatal_error("MBB is part of two funclets!"); - } + if (FuncletMembership[MBB] != Funclet) { + assert(false && "MBB is part of two funclets!"); + report_fatal_error("MBB is part of two funclets!"); } return; } -- cgit v1.2.3