[llvm-commits] CVS: llvm/lib/Transforms/IPO/Inliner.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jul 12 11:29:51 PDT 2006



Changes in directory llvm/lib/Transforms/IPO:

Inliner.cpp updated: 1.28 -> 1.29
---
Log message:

Change the callgraph representation to store the callsite along with the
target CG node.  This allows the inliner to properly update the callgraph
when using the pruning inliner.  The pruning inliner may not copy over all
call sites from a callee to a caller, so the edges corresponding to those
call sites should not be copied over either.

This fixes PR827: http://llvm.org/PR827  and Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll



---
Diffs of the changes:  (+2 -2)

 Inliner.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/IPO/Inliner.cpp
diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.28 llvm/lib/Transforms/IPO/Inliner.cpp:1.29
--- llvm/lib/Transforms/IPO/Inliner.cpp:1.28	Fri May 12 18:35:26 2006
+++ llvm/lib/Transforms/IPO/Inliner.cpp	Wed Jul 12 13:29:36 2006
@@ -54,7 +54,7 @@
     // Remove any call graph edges from the callee to its callees.
     CallGraphNode *CalleeNode = CG[Callee];
     while (CalleeNode->begin() != CalleeNode->end())
-      CalleeNode->removeCallEdgeTo(*(CalleeNode->end()-1));
+      CalleeNode->removeCallEdgeTo((CalleeNode->end()-1)->second);
 
     // Removing the node for callee from the call graph and delete it.
     delete CG.removeFunctionFromModule(CalleeNode);
@@ -168,7 +168,7 @@
 
         // Remove any call graph edges from the function to its callees.
         while (CGN->begin() != CGN->end())
-          CGN->removeCallEdgeTo(*(CGN->end()-1));
+          CGN->removeCallEdgeTo((CGN->end()-1)->second);
 
         // 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