diff options
author | Owen Anderson <resistor@mac.com> | 2008-09-05 23:36:01 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-09-05 23:36:01 +0000 |
commit | 134f6e5b6d7246384eaaeacbf5052a3a218cc887 (patch) | |
tree | 78acc35e61261c50375bff374e13984acdcdce54 /lib/Transforms/IPO/PruneEH.cpp | |
parent | 7fa52cae3b36df1f45f50289d684d8fbe56503b6 (diff) | |
download | external_llvm-134f6e5b6d7246384eaaeacbf5052a3a218cc887.zip external_llvm-134f6e5b6d7246384eaaeacbf5052a3a218cc887.tar.gz external_llvm-134f6e5b6d7246384eaaeacbf5052a3a218cc887.tar.bz2 |
Revert r55859. This is breaking the build in the abscence of its companion commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/PruneEH.cpp')
-rw-r--r-- | lib/Transforms/IPO/PruneEH.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp index 94d6331..8fb904b 100644 --- a/lib/Transforms/IPO/PruneEH.cpp +++ b/lib/Transforms/IPO/PruneEH.cpp @@ -222,10 +222,13 @@ 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)) - CGN->removeCallEdgeFor(CI); - else if (InvokeInst *II = dyn_cast<InvokeInst>(I)) - CGN->removeCallEdgeFor(II); + 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 (!I->use_empty()) I->replaceAllUsesWith(UndefValue::get(I->getType())); } |