aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/DataStructure
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-10 18:18:18 +0000
committerChris Lattner <sabre@nondot.org>2003-02-10 18:18:18 +0000
commit2609c07df305eb0e6dc6c130732f3ca101ed2dc4 (patch)
tree61f19b5a80e2fce6417eb05dbbf9cbf2a297d272 /lib/Analysis/DataStructure
parentc40c905d63635ce69742503619bc21dcd9fc6d9a (diff)
downloadexternal_llvm-2609c07df305eb0e6dc6c130732f3ca101ed2dc4.zip
external_llvm-2609c07df305eb0e6dc6c130732f3ca101ed2dc4.tar.gz
external_llvm-2609c07df305eb0e6dc6c130732f3ca101ed2dc4.tar.bz2
Fix problem breaking GAP, use hasNoReferrers more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r--lib/Analysis/DataStructure/DataStructure.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index 30ce4f9..ab18c4e 100644
--- a/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/lib/Analysis/DataStructure/DataStructure.cpp
@@ -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
}