From 14e773500e036de57ed0ca4af6fddc1f8b6767d8 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 9 Oct 2015 23:34:53 +0000 Subject: [WinEH] Delete the old landingpad implementation of Windows EH The new implementation works at least as well as the old implementation did. Also delete the associated preparation tests. They don't exercise interesting corner cases of the new implementation. All the codegen tests of the EH tables have already been ported. llvm-svn: 249918 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 37 ---------------------- 1 file changed, 37 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 0df05683b4f..2a25131dbad 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -973,43 +973,6 @@ bool SelectionDAGISel::PrepareEHLandingPad() { BuildMI(*MBB, FuncInfo->InsertPt, SDB->getCurDebugLoc(), II) .addSym(Label); - // If this personality function uses funclets, we need to split the landing - // pad into several BBs. - const Constant *Personality = MF->getFunction()->getPersonalityFn(); - if (const auto *PF = dyn_cast(Personality->stripPointerCasts())) - MF->getMMI().addPersonality(PF); - EHPersonality PersonalityType = classifyEHPersonality(Personality); - - if (isFuncletEHPersonality(PersonalityType)) { - SmallVector ClauseBBs; - const IntrinsicInst *ActionsCall = - dyn_cast(LLVMBB->getFirstInsertionPt()); - // Get all invoke BBs that unwind to this landingpad. - SmallVector InvokeBBs(MBB->pred_begin(), - MBB->pred_end()); - if (ActionsCall && ActionsCall->getIntrinsicID() == Intrinsic::eh_actions) { - // If this is a call to llvm.eh.actions followed by indirectbr, then we've - // run WinEHPrepare, and we should remove this block from the machine CFG. - // Mark the targets of the indirectbr as landingpads instead. - for (const BasicBlock *LLVMSucc : successors(LLVMBB)) { - MachineBasicBlock *ClauseBB = FuncInfo->MBBMap[LLVMSucc]; - // Add the edge from the invoke to the clause. - for (MachineBasicBlock *InvokeBB : InvokeBBs) - InvokeBB->addSuccessor(ClauseBB); - - // Mark the clause as a landing pad or MI passes will delete it. - ClauseBB->setIsEHPad(); - } - } - - // Remove the edge from the invoke to the lpad. - for (MachineBasicBlock *InvokeBB : InvokeBBs) - InvokeBB->removeSuccessor(MBB); - - // Don't select instructions for the landingpad. - return false; - } - // Mark exception register as live in. if (unsigned Reg = TLI->getExceptionPointerRegister()) FuncInfo->ExceptionPointerVirtReg = MBB->addLiveIn(Reg, PtrRC); -- cgit v1.2.3