mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
Remove dead nodes more efficiently
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5462 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a1220afc3a
commit
5e7d0e2691
@ -1095,7 +1095,8 @@ void DSGraph::removeDeadNodes(unsigned Flags) {
|
||||
for (unsigned i = 0; i != Nodes.size(); ++i)
|
||||
if (!Alive.count(Nodes[i])) {
|
||||
DSNode *N = Nodes[i];
|
||||
Nodes.erase(Nodes.begin()+i--); // Erase node from alive list.
|
||||
std::swap(Nodes[i--], Nodes.back()); // move node to end of vector
|
||||
Nodes.pop_back(); // Erase node from alive list.
|
||||
DeadNodes.push_back(N); // Add node to our list of dead nodes
|
||||
N->dropAllReferences(); // Drop all outgoing edges
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user