summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-09-08 11:05:51 +0000
committerDuncan Sands <baldrick@free.fr>2008-09-08 11:05:51 +0000
commitd7b9851c4e634ed3599b1a4c70b1c76c90a11686 (patch)
treee6d0ee180e8d76901ea2b62013a8aea5966d0b22 /lib/Transforms/IPO
parent98d2d07d416b3431a298eec5a2bfe8b39652c3aa (diff)
downloadllvm-d7b9851c4e634ed3599b1a4c70b1c76c90a11686.tar.gz
llvm-d7b9851c4e634ed3599b1a4c70b1c76c90a11686.tar.bz2
llvm-d7b9851c4e634ed3599b1a4c70b1c76c90a11686.tar.xz
Reapply 55859. This doesn't change anything as
long as the callgraph is correct. It checks for wrong callgraphs more strictly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp
index 630768fbdc..297c6c1541 100644
--- a/lib/Transforms/IPO/PruneEH.cpp
+++ b/lib/Transforms/IPO/PruneEH.cpp
@@ -228,13 +228,10 @@ void PruneEH::DeleteBasicBlock(BasicBlock *BB) {
CallGraphNode *CGN = CG[BB->getParent()];
for (BasicBlock::iterator I = BB->end(), E = BB->begin(); I != E; ) {
--I;
- if (CallInst *CI = dyn_cast<CallInst>(I)) {
- if (Function *Callee = CI->getCalledFunction())
- CGN->removeCallEdgeTo(CG[Callee]);
- } else if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
- if (Function *Callee = II->getCalledFunction())
- CGN->removeCallEdgeTo(CG[Callee]);
- }
+ if (CallInst *CI = dyn_cast<CallInst>(I))
+ CGN->removeCallEdgeFor(CI);
+ else if (InvokeInst *II = dyn_cast<InvokeInst>(I))
+ CGN->removeCallEdgeFor(II);
if (!I->use_empty())
I->replaceAllUsesWith(UndefValue::get(I->getType()));
}