mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 17:25:21 +00:00
move ReplaceNode out of line, rename scc_iterator::fini -> isAtEnd().
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -307,18 +307,17 @@ bool CGPassManager::runOnModule(Module &M) {
|
||||
CallGraph &CG = getAnalysis<CallGraph>();
|
||||
bool Changed = doInitialization(CG);
|
||||
|
||||
CallGraphSCC CurSCC(this);
|
||||
|
||||
// Walk the callgraph in bottom-up SCC order.
|
||||
for (scc_iterator<CallGraph*> CGI = scc_begin(&CG), E = scc_end(&CG);
|
||||
CGI != E;) {
|
||||
scc_iterator<CallGraph*> CGI = scc_begin(&CG);
|
||||
|
||||
CallGraphSCC CurSCC(&CGI);
|
||||
while (!CGI.isAtEnd()) {
|
||||
// Copy the current SCC and increment past it so that the pass can hack
|
||||
// on the SCC if it wants to without invalidating our iterator.
|
||||
std::vector<CallGraphNode*> &NodeVec = *CGI;
|
||||
CurSCC.initialize(&NodeVec[0], &NodeVec[0]+NodeVec.size());
|
||||
++CGI;
|
||||
|
||||
|
||||
// CallGraphUpToDate - Keep track of whether the callgraph is known to be
|
||||
// up-to-date or not. The CGSSC pass manager runs two types of passes:
|
||||
// CallGraphSCC Passes and other random function passes. Because other
|
||||
@@ -408,6 +407,17 @@ bool CGPassManager::doFinalization(CallGraph &CG) {
|
||||
// CallGraphSCC Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/// ReplaceNode - This informs the SCC and the pass manager that the specified
|
||||
/// Old node has been deleted, and New is to be used in its place.
|
||||
void CallGraphSCC::ReplaceNode(CallGraphNode *Old, CallGraphNode *New) {
|
||||
assert(Old != New && "Should not replace node with self");
|
||||
for (unsigned i = 0; ; ++i) {
|
||||
assert(i != Nodes.size() && "Node not in SCC");
|
||||
if (Nodes[i] != Old) continue;
|
||||
Nodes[i] = New;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Reference in New Issue
Block a user