summaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-01 20:33:43 +0000
committerChris Lattner <sabre@nondot.org>2009-09-01 20:33:43 +0000
commit44a18370e0fe77a1b31698e945a9ce9f691364fb (patch)
treeeb4858551d61b0a7a5d927683cd35a0011eab9bf /lib/Analysis/IPA
parent0bb83860f9e105f451beee16fe3cf0fe28d65a81 (diff)
downloadllvm-44a18370e0fe77a1b31698e945a9ce9f691364fb.tar.gz
llvm-44a18370e0fe77a1b31698e945a9ce9f691364fb.tar.bz2
llvm-44a18370e0fe77a1b31698e945a9ce9f691364fb.tar.xz
Fix a regression I introduced in r80708, found by llvm-test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r--lib/Analysis/IPA/CallGraphSCCPass.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp
index f7c38e2cce..b188d3091c 100644
--- a/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -94,10 +94,10 @@ bool CGPassManager::RunPassOnSCC(Pass *P, std::vector<CallGraphNode*> &CurSCC,
RefreshCallGraph(CurSCC, CG, false);
CallGraphUpToDate = true;
}
-
- StartPassTimer(P);
+
+ StartPassTimer(CGSP);
Changed = CGSP->runOnSCC(CurSCC);
- StopPassTimer(P);
+ StopPassTimer(CGSP);
// After the CGSCCPass is done, when assertions are enabled, use
// RefreshCallGraph to verify that the callgraph was correctly updated.
@@ -227,8 +227,15 @@ void CGPassManager::RefreshCallGraph(std::vector<CallGraphNode*> &CurSCC,
CalleeNode = CG.getOrInsertFunction(Callee);
else
CalleeNode = CG.getCallsExternalNode();
-
- ExistingIt->second = CalleeNode;
+
+ // Update the edge target in CGN.
+ for (CallGraphNode::iterator I = CGN->begin(); ; ++I) {
+ assert(I != CGN->end() && "Didn't find call entry");
+ if (I->first == CS.getInstruction()) {
+ I->second = CalleeNode;
+ break;
+ }
+ }
MadeChange = true;
continue;
}