[llvm-commits] [llvm] r55836 - /llvm/trunk/lib/Transforms/IPO/Inliner.cpp

Duncan Sands baldrick at free.fr
Fri Sep 5 07:57:02 PDT 2008


Author: baldrick
Date: Fri Sep  5 09:56:53 2008
New Revision: 55836

URL: http://llvm.org/viewvc/llvm-project?rev=55836&view=rev
Log:
Use removeAllCalledFunctions rather than removing
edges one by one by hand.

Modified:
    llvm/trunk/lib/Transforms/IPO/Inliner.cpp

Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=55836&r1=55835&r2=55836&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Fri Sep  5 09:56:53 2008
@@ -61,11 +61,10 @@
   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 @@
           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





More information about the llvm-commits mailing list