mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
Fix problem breaking GAP, use hasNoReferrers more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5530 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c40c905d63
commit
2609c07df3
@ -86,7 +86,7 @@ void DSNode::foldNodeCompletely() {
|
||||
(*I)->setOffset(0);
|
||||
|
||||
// If we have links, merge all of our outgoing links together...
|
||||
for (unsigned i = 1, e = Links.size(); i < e; ++i)
|
||||
for (unsigned i = 1; i < Links.size(); ++i)
|
||||
Links[0].mergeWith(Links[i]);
|
||||
Links.resize(1);
|
||||
}
|
||||
@ -903,8 +903,8 @@ void DSGraph::removeTriviallyDeadNodes() {
|
||||
}
|
||||
}
|
||||
|
||||
if ((Node->NodeType & ~DSNode::DEAD) == 0 &&
|
||||
Node->getReferrers().empty()) { // This node is dead!
|
||||
if ((Node->NodeType & ~DSNode::DEAD) == 0 && Node->hasNoReferrers()) {
|
||||
// This node is dead!
|
||||
delete Node; // Free memory...
|
||||
Nodes.erase(Nodes.begin()+i--); // Remove from node list...
|
||||
}
|
||||
@ -1066,7 +1066,7 @@ void DSGraph::removeDeadNodes(unsigned Flags) {
|
||||
assert(((N->NodeType & DSNode::GlobalNode) == 0 ||
|
||||
(Flags & DSGraph::RemoveUnreachableGlobals))
|
||||
&& "Killing a global?");
|
||||
while (!N->getReferrers().empty()) // Rewrite referrers
|
||||
while (!N->hasNoReferrers()) // Rewrite referrers
|
||||
N->getReferrers().back()->setNode(0);
|
||||
delete N; // Usecount is zero
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user