summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-09-05 14:56:53 +0000
committerDuncan Sands <baldrick@free.fr>2008-09-05 14:56:53 +0000
commit6f0a7687ab9a0509e847279fae27554ce7da0ba1 (patch)
treea15b84887529b0826b868176c89797d15644c532 /lib/Transforms/IPO
parenta7212e58260f6d1ead0c4eec7af400cf6c0d289e (diff)
downloadllvm-6f0a7687ab9a0509e847279fae27554ce7da0ba1.tar.gz
llvm-6f0a7687ab9a0509e847279fae27554ce7da0ba1.tar.bz2
llvm-6f0a7687ab9a0509e847279fae27554ce7da0ba1.tar.xz
Use removeAllCalledFunctions rather than removing
edges one by one by hand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55836 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/Inliner.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index 88b6afdebb..d9609489a9 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -61,11 +61,10 @@ static bool InlineCallIfPossible(CallSite CS, CallGraph &CG,
if (Callee->use_empty() && Callee->hasInternalLinkage() &&
!SCCFunctions.count(Callee)) {
DOUT << " -> Deleting dead function: " << Callee->getName() << "\n";
+ CallGraphNode *CalleeNode = CG[Callee];
// Remove any call graph edges from the callee to its callees.
- CallGraphNode *CalleeNode = CG[Callee];
- while (!CalleeNode->empty())
- CalleeNode->removeCallEdgeTo((CalleeNode->end()-1)->second);
+ CalleeNode->removeAllCalledFunctions();
// Removing the node for callee from the call graph and delete it.
delete CG.removeFunctionFromModule(CalleeNode);
@@ -198,8 +197,7 @@ bool Inliner::doFinalization(CallGraph &CG) {
F->use_empty()) {
// Remove any call graph edges from the function to its callees.
- while (!CGN->empty())
- CGN->removeCallEdgeTo((CGN->end()-1)->second);
+ CGN->removeAllCalledFunctions();
// Remove any edges from the external node to the function's call graph
// node. These edges might have been made irrelegant due to