1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Provided accessors to internal allocator for ImutAVLTree and ImmutableSet.

Added postfix ++,-- support for ImmutableSet::iterator.

llvm-svn: 42877
This commit is contained in:
Ted Kremenek 2007-10-11 21:51:04 +00:00
parent 9486be1cf2
commit ee654dc6ef

View File

@ -294,6 +294,8 @@ public:
TreeTy* GetEmptyTree() const { return NULL; }
BumpPtrAllocator& getAllocator() { return Allocator; }
//===--------------------------------------------------===//
// A bunch of quick helper functions used for reasoning
// about the properties of trees and their children.
@ -336,6 +338,7 @@ private:
// FIXME: more intelligent calculation of alignment.
TreeTy* T = (TreeTy*) Allocator.Allocate(sizeof(*T),16);
new (T) TreeTy(L,R,V,IncrementHeight(L,R));
Cache.InsertNode(T,InsertPos);
@ -816,6 +819,8 @@ public:
return ImmutableSet(F.Remove(Old.Root,V));
}
BumpPtrAllocator& getAllocator() { return F.getAllocator(); }
private:
Factory(const Factory& RHS) {};
void operator=(const Factory& RHS) {};
@ -858,7 +863,9 @@ public:
public:
inline value_type_ref operator*() const { return itr->getValue(); }
inline iterator& operator++() { ++itr; return *this; }
inline iterator operator++(int) { iterator tmp(*this); ++itr; return tmp; }
inline iterator& operator--() { --itr; return *this; }
inline iterator operator--(int) { iterator tmp(*this); --itr; return tmp; }
inline bool operator==(const iterator& RHS) const { return RHS.itr == itr; }
inline bool operator!=(const iterator& RHS) const { return RHS.itr != itr; }
};