diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-22 20:42:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-22 20:42:33 +0000 |
commit | 055cf267db3ef12f213e112a2c80e721c792c2f8 (patch) | |
tree | a2e1646b9a7002669df5f19c4e73d4ba9884ba6f /llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | |
parent | 0a3b5b4e39ebf59634ce4552f718cc0cb5ce5389 (diff) | |
download | bcm5719-llvm-055cf267db3ef12f213e112a2c80e721c792c2f8.tar.gz bcm5719-llvm-055cf267db3ef12f213e112a2c80e721c792c2f8.zip |
add a DEBUG call so that -debug lists when CGSCCPM iterates.
Fix RefreshCallGraph to use CGN->replaceCallEdge instead of hand
rolling its own loop. replaceCallEdge properly maintains the
reference counts of the nodes, fixing a crash exposed by the
iterative callgraph stuff.
llvm-svn: 102120
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp index 6562e511e78..917aa990ceb 100644 --- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -278,13 +278,7 @@ bool CGPassManager::RefreshCallGraph(CallGraphSCC &CurSCC, } // 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; - } - } + CGN->replaceCallEdge(CS, CS, CalleeNode); MadeChange = true; continue; } @@ -422,6 +416,9 @@ bool CGPassManager::runOnModule(Module &M) { unsigned Iteration = 0; bool DevirtualizedCall = false; do { + DEBUG(if (Iteration) + dbgs() << " SCCPASSMGR: Re-visiting SCC, iteration #" + << Iteration << '\n'); DevirtualizedCall = false; Changed |= RunAllPassesOnSCC(CurSCC, CG, DevirtualizedCall); } while (Iteration++ < MaxIterations && DevirtualizedCall); |