summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/PruneEH.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/PruneEH.cpp b/llvm/lib/Transforms/IPO/PruneEH.cpp
index c2f55d896ba..22a95fa03f7 100644
--- a/llvm/lib/Transforms/IPO/PruneEH.cpp
+++ b/llvm/lib/Transforms/IPO/PruneEH.cpp
@@ -252,7 +252,8 @@ void PruneEH::DeleteBasicBlock(BasicBlock *BB) {
}
if (TokenInst) {
- changeToUnreachable(TokenInst->getNextNode(), /*UseLLVMTrap=*/false);
+ if (!isa<TerminatorInst>(TokenInst))
+ changeToUnreachable(TokenInst->getNextNode(), /*UseLLVMTrap=*/false);
} else {
// Get the list of successors of this block.
std::vector<BasicBlock *> Succs(succ_begin(BB), succ_end(BB));
OpenPOWER on IntegriCloud