[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
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index 74ece38..b0d99a8 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -343,15 +343,7 @@
continue;
Instruction *Replacement = nullptr;
- if (auto *TPI = dyn_cast<TerminatePadInst>(I)) {
- if (TPI->unwindsToCaller()) {
- SmallVector<Value *, 3> TerminatePadArgs;
- for (Value *ArgOperand : TPI->arg_operands())
- TerminatePadArgs.push_back(ArgOperand);
- Replacement = TerminatePadInst::Create(TPI->getParentPad(), UnwindDest,
- TerminatePadArgs, TPI);
- }
- } else if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(I)) {
+ if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(I)) {
if (CatchSwitch->unwindsToCaller()) {
auto *NewCatchSwitch = CatchSwitchInst::Create(
CatchSwitch->getParentPad(), UnwindDest,
@@ -1441,10 +1433,7 @@
if (!I->isEHPad())
continue;
- if (auto *TPI = dyn_cast<TerminatePadInst>(I)) {
- if (isa<ConstantTokenNone>(TPI->getParentPad()))
- TPI->setParentPad(CallSiteEHPad);
- } else if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(I)) {
+ if (auto *CatchSwitch = dyn_cast<CatchSwitchInst>(I)) {
if (isa<ConstantTokenNone>(CatchSwitch->getParentPad()))
CatchSwitch->setParentPad(CallSiteEHPad);
} else {