aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-10-11 21:51:04 +0000
committerTed Kremenek <kremenek@apple.com>2007-10-11 21:51:04 +0000
commit0b22da3d7361f94c3811f2e7d603bb3513dc3d1c (patch)
tree3e11971f16c4c99ad2fc8543e3ead99d4cfae56b
parent83e105c600159e8d33fa3c421a163c1850483cfd (diff)
Provided accessors to internal allocator for ImutAVLTree and ImmutableSet.
Added postfix ++,-- support for ImmutableSet::iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42877 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/ImmutableSet.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h
index 30815751de..84eb50803e 100644
--- a/include/llvm/ADT/ImmutableSet.h
+++ b/include/llvm/ADT/ImmutableSet.h
@@ -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; }
};