summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-10-27 22:43:56 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-10-27 22:43:56 +0000
commit492937095f32aaf07125c22350c4cf2d31d33fca (patch)
tree25a427cd6b6f7edd82195b31c0b71eb5e7b18443 /llvm/lib/Transforms
parentaf383ff70c30b422d919210cfd7e6a61e62405b9 (diff)
downloadbcm5719-llvm-492937095f32aaf07125c22350c4cf2d31d33fca.tar.gz
bcm5719-llvm-492937095f32aaf07125c22350c4cf2d31d33fca.zip
[SimplifyCFG] Don't DCE catchret because the successor is unreachable
CatchReturnInst has side-effects: it runs a destructor. This destructor could conceivably run forever/call exit/etc. and should not be removed. llvm-svn: 251461
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index e435537c3a7..69c08e55283 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -3178,8 +3178,7 @@ bool SimplifyCFGOpt::SimplifyUnreachable(UnreachableInst *UI) {
isa<CatchEndPadInst>(TI) || isa<TerminatePadInst>(TI)) {
removeUnwindEdge(TI->getParent());
Changed = true;
- } else if (isa<CleanupReturnInst>(TI) || isa<CleanupEndPadInst>(TI) ||
- isa<CatchReturnInst>(TI)) {
+ } else if (isa<CleanupReturnInst>(TI) || isa<CleanupEndPadInst>(TI)) {
new UnreachableInst(TI->getContext(), TI);
TI->eraseFromParent();
Changed = true;
OpenPOWER on IntegriCloud