diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-12-14 18:34:23 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-12-14 18:34:23 +0000 |
| commit | bbfc7219ef121d345784b0c080a268beb051c736 (patch) | |
| tree | df2b7b2e6f57615a58d0d86aef7fa03081649176 /llvm/lib/IR/Verifier.cpp | |
| parent | feeefb214dfa398df4cec92b1e9f3e3219d3944f (diff) | |
| download | bcm5719-llvm-bbfc7219ef121d345784b0c080a268beb051c736.tar.gz bcm5719-llvm-bbfc7219ef121d345784b0c080a268beb051c736.zip | |
[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
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
| -rw-r--r-- | llvm/lib/IR/Verifier.cpp | 38 |
1 files changed, 2 insertions, 36 deletions
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<InvokeInst>(TI)) { Assert(II->getUnwindDest() == BB && II->getNormalDest() != BB, "EH pad must be jumped to via an unwind edge", &I, II); - } else if (!isa<CleanupReturnInst>(TI) && !isa<TerminatePadInst>(TI) && - !isa<CatchSwitchInst>(TI)) { + } else if (!isa<CleanupReturnInst>(TI) && !isa<CatchSwitchInst>(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<CleanupReturnInst>(U)) { UnwindDest = CRI->getUnwindDest(); - } else if (isa<CleanupPadInst>(U) || isa<CatchSwitchInst>(U) || - isa<TerminatePadInst>(U)) { + } else if (isa<CleanupPadInst>(U) || isa<CatchSwitchInst>(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<LandingPadInst>(I), - "TerminatePadInst must unwind to an EH block which is not a " - "landingpad.", - &TPI); - } - - auto *ParentPad = TPI.getParentPad(); - Assert(isa<CatchSwitchInst>(ParentPad) || isa<ConstantTokenNone>(ParentPad) || - isa<CleanupPadInst>(ParentPad) || isa<CatchPadInst>(ParentPad), - "TerminatePadInst has an invalid parent.", ParentPad); - - visitTerminatorInst(TPI); -} - void Verifier::verifyDominatesUse(Instruction &I, unsigned i) { Instruction *Op = cast<Instruction>(I.getOperand(i)); // If the we have an invalid invoke, don't try to compute the dominance. |

