summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit3a52056d4df5fcfe3834a33513645fcc9569bd62 (patch)
tree8d67a61341639498ce983a7f303b8ed2d4850112 /llvm/lib
parent7c8fb1ad935c23cd70987bb0ebf4cead6f56f7db (diff)
downloadbcm5719-llvm-3a52056d4df5fcfe3834a33513645fcc9569bd62.tar.gz
bcm5719-llvm-3a52056d4df5fcfe3834a33513645fcc9569bd62.zip
Use removeAllCalledFunctions rather than removing
edges one by one by hand. llvm-svn: 55836
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/Inliner.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index 88b6afdebb7..d9609489a9d 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud