diff options
author | Chris Lattner <sabre@nondot.org> | 2002-07-10 22:42:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-07-10 22:42:17 +0000 |
commit | cd0b36fb0747c7cf3202fa0633aa7a40fbdbfc3b (patch) | |
tree | 7ede795ae6f0331a399d085eb505f4a14bd46b86 /include/llvm/Analysis/DataStructureGraph.h | |
parent | c68c31b2d3623f01bfcd1405ec005536d0815970 (diff) | |
download | external_llvm-cd0b36fb0747c7cf3202fa0633aa7a40fbdbfc3b.zip external_llvm-cd0b36fb0747c7cf3202fa0633aa7a40fbdbfc3b.tar.gz external_llvm-cd0b36fb0747c7cf3202fa0633aa7a40fbdbfc3b.tar.bz2 |
New implementation of data structure analysis
This diff is completely meaningless because this is a replacement
implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2872 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DataStructureGraph.h')
-rw-r--r-- | include/llvm/Analysis/DataStructureGraph.h | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/include/llvm/Analysis/DataStructureGraph.h b/include/llvm/Analysis/DataStructureGraph.h index 3b6ff74..0a25622 100644 --- a/include/llvm/Analysis/DataStructureGraph.h +++ b/include/llvm/Analysis/DataStructureGraph.h @@ -16,40 +16,34 @@ class DSNodeIterator : public std::forward_iterator<DSNode, ptrdiff_t> { friend class DSNode; DSNode * const Node; unsigned Link; - unsigned LinkIdx; typedef DSNodeIterator _Self; - DSNodeIterator(DSNode *N) : Node(N), Link(0), LinkIdx(0) { // begin iterator - unsigned NumLinks = Node->getNumOutgoingLinks(); - while (Link < NumLinks && Node->getOutgoingLink(Link).empty()) + DSNodeIterator(DSNode *N) : Node(N), Link(0) { // begin iterator + unsigned NumLinks = Node->getNumLinks(); + while (Link < NumLinks && Node->getLink(Link) == 0) ++Link; } DSNodeIterator(DSNode *N, bool) // Create end iterator - : Node(N), Link(N->getNumOutgoingLinks()), LinkIdx(0) { + : Node(N), Link(N->getNumLinks()) { } public: bool operator==(const _Self& x) const { - return Link == x.Link && LinkIdx == x.LinkIdx; + return Link == x.Link; } bool operator!=(const _Self& x) const { return !operator==(x); } pointer operator*() const { - return Node->getOutgoingLink(Link)[LinkIdx].getNode(); + return Node->getLink(Link); } pointer operator->() const { return operator*(); } _Self& operator++() { // Preincrement - if (LinkIdx < Node->getOutgoingLink(Link).size()-1) - ++LinkIdx; - else { - unsigned NumLinks = Node->getNumOutgoingLinks(); - do { - ++Link; - } while (Link < NumLinks && Node->getOutgoingLink(Link).empty()); - LinkIdx = 0; - } + unsigned NumLinks = Node->getNumLinks(); + do { + ++Link; + } while (Link < NumLinks && Node->getLink(Link) != 0); return *this; } _Self operator++(int) { // Postincrement |