Dramatically simplify internal DSNode representation, get implementation

*FULLY OPERATIONAL* and safe.  We are now capable of completely analyzing
at LEAST the Olden benchmarks + 181.mcf


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2002-11-06 06:20:27 +00:00
parent 4268c93b00
commit 08db719c4b
9 changed files with 441 additions and 593 deletions

View File

@@ -23,7 +23,9 @@ class DSNodeIterator : public forward_iterator<const DSNode, ptrdiff_t> {
DSNodeIterator(const DSNode *N) : Node(N), Offset(0) {} // begin iterator
DSNodeIterator(const DSNode *N, bool) // Create end iterator
: Node(N), Offset(N->getSize()) {
: Node(N) {
Offset = (N->getSize()+((1 << DS::PointerShift)-1)) &
~((1 << DS::PointerShift)-1);
}
public:
DSNodeIterator(const DSNodeHandle &NH)
@@ -41,13 +43,12 @@ public:
}
pointer operator*() const {
const DSNodeHandle *NH = Node->getLink(Offset);
return NH ? NH->getNode() : 0;
return Node->getLink(Offset).getNode();
}
pointer operator->() const { return operator*(); }
_Self& operator++() { // Preincrement
++Offset;
Offset += (1 << DS::PointerShift);
return *this;
}
_Self operator++(int) { // Postincrement