summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/Inliner.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-12 18:29:36 +0000
committerChris Lattner <sabre@nondot.org>2006-07-12 18:29:36 +0000
commit5de3b8b26264ccd11a4141d41061ea2040fa69ca (patch)
treebb3db50f3bd6e2fb0d8cd818fffbf08cd75950e3 /llvm/lib/Transforms/IPO/Inliner.cpp
parentc7012cc9e92071b268e8557e3a886dd26135a5d3 (diff)
downloadbcm5719-llvm-5de3b8b26264ccd11a4141d41061ea2040fa69ca.tar.gz
bcm5719-llvm-5de3b8b26264ccd11a4141d41061ea2040fa69ca.zip
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 and Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll llvm-svn: 29120
Diffstat (limited to 'llvm/lib/Transforms/IPO/Inliner.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/Inliner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index 89999bb4425..ae4032bbfb3 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -54,7 +54,7 @@ static bool InlineCallIfPossible(CallSite CS, CallGraph &CG,
// 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 @@ bool Inliner::doFinalization(CallGraph &CG) {
// 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
OpenPOWER on IntegriCloud