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 | 339c82df85549ac6bb7cf0e085fd9e140e807b85 (patch) | |
tree | b05c93a3a3a8690a33d6e8805fb1a965c57f6606 /llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | |
parent | 92e18c456afdade9fd4d19e74aee12823cc72217 (diff) | |
download | bcm5719-llvm-339c82df85549ac6bb7cf0e085fd9e140e807b85.tar.gz bcm5719-llvm-339c82df85549ac6bb7cf0e085fd9e140e807b85.zip |
Fix a regression I introduced in r80708, found by llvm-test.
llvm-svn: 80718
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp index f7c38e2cce2..b188d3091c8 100644 --- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/llvm/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; } |