From bbfc7219ef121d345784b0c080a268beb051c736 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Mon, 14 Dec 2015 18:34:23 +0000 Subject: [IR] Remove terminatepad It turns out that terminatepad gives little benefit over a cleanuppad which calls the termination function. This is not sufficient to implement fully generic filters but MSVC doesn't support them which makes terminatepad a little over-designed. Depends on D15478. Differential Revision: http://reviews.llvm.org/D15479 llvm-svn: 255522 --- llvm/lib/IR/Verifier.cpp | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) (limited to 'llvm/lib/IR/Verifier.cpp') diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 9862bfcc4fa..234ab29d8ed 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -403,7 +403,6 @@ private: void visitCleanupPadInst(CleanupPadInst &CPI); void visitCatchSwitchInst(CatchSwitchInst &CatchSwitch); void visitCleanupReturnInst(CleanupReturnInst &CRI); - void visitTerminatePadInst(TerminatePadInst &TPI); void VerifyCallSite(CallSite CS); void verifyMustTailCall(CallInst &CI); @@ -2899,8 +2898,7 @@ void Verifier::visitEHPadPredecessors(Instruction &I) { if (auto *II = dyn_cast(TI)) { Assert(II->getUnwindDest() == BB && II->getNormalDest() != BB, "EH pad must be jumped to via an unwind edge", &I, II); - } else if (!isa(TI) && !isa(TI) && - !isa(TI)) { + } else if (!isa(TI) && !isa(TI)) { Assert(false, "EH pad must be jumped to via an unwind edge", &I, TI); } } @@ -3002,8 +3000,7 @@ void Verifier::visitCleanupPadInst(CleanupPadInst &CPI) { BasicBlock *UnwindDest; if (CleanupReturnInst *CRI = dyn_cast(U)) { UnwindDest = CRI->getUnwindDest(); - } else if (isa(U) || isa(U) || - isa(U)) { + } else if (isa(U) || isa(U)) { continue; } else { Assert(false, "bogus cleanuppad use", &CPI); @@ -3072,37 +3069,6 @@ void Verifier::visitCleanupReturnInst(CleanupReturnInst &CRI) { visitTerminatorInst(CRI); } -void Verifier::visitTerminatePadInst(TerminatePadInst &TPI) { - visitEHPadPredecessors(TPI); - - BasicBlock *BB = TPI.getParent(); - Function *F = BB->getParent(); - Assert(F->hasPersonalityFn(), - "TerminatePadInst needs to be in a function with a personality.", - &TPI); - - // The terminatepad instruction must be the first non-PHI instruction in the - // block. - Assert(BB->getFirstNonPHI() == &TPI, - "TerminatePadInst not the first non-PHI instruction in the block.", - &TPI); - - if (BasicBlock *UnwindDest = TPI.getUnwindDest()) { - Instruction *I = UnwindDest->getFirstNonPHI(); - Assert(I->isEHPad() && !isa(I), - "TerminatePadInst must unwind to an EH block which is not a " - "landingpad.", - &TPI); - } - - auto *ParentPad = TPI.getParentPad(); - Assert(isa(ParentPad) || isa(ParentPad) || - isa(ParentPad) || isa(ParentPad), - "TerminatePadInst has an invalid parent.", ParentPad); - - visitTerminatorInst(TPI); -} - void Verifier::verifyDominatesUse(Instruction &I, unsigned i) { Instruction *Op = cast(I.getOperand(i)); // If the we have an invalid invoke, don't try to compute the dominance. -- cgit v1.2.3