diff options
author | Chris Lattner <sabre@nondot.org> | 2009-09-01 20:33:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-09-01 20:33:43 +0000 |
commit | 44a18370e0fe77a1b31698e945a9ce9f691364fb (patch) | |
tree | eb4858551d61b0a7a5d927683cd35a0011eab9bf | |
parent | 0bb83860f9e105f451beee16fe3cf0fe28d65a81 (diff) | |
download | external_llvm-44a18370e0fe77a1b31698e945a9ce9f691364fb.zip external_llvm-44a18370e0fe77a1b31698e945a9ce9f691364fb.tar.gz external_llvm-44a18370e0fe77a1b31698e945a9ce9f691364fb.tar.bz2 |
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
-rw-r--r-- | lib/Analysis/IPA/CallGraphSCCPass.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp index f7c38e2..b188d30 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; } |