summaryrefslogtreecommitdiffstats
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
commit3b74526054da71f725dc96da0312c97e16ee68b8 (patch)
tree046606e7904c9ba05f3e5fcfdb23bb9c514a2a06
parent62f65edc32a61164f119ecb433477071b621004e (diff)
downloadbcm5719-llvm-3b74526054da71f725dc96da0312c97e16ee68b8.tar.gz
bcm5719-llvm-3b74526054da71f725dc96da0312c97e16ee68b8.zip
Provided accessors to internal allocator for ImutAVLTree and ImmutableSet.
Added postfix ++,-- support for ImmutableSet::iterator. llvm-svn: 42877
-rw-r--r--llvm/include/llvm/ADT/ImmutableSet.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/ImmutableSet.h b/llvm/include/llvm/ADT/ImmutableSet.h
index 30815751de2..84eb50803eb 100644
--- a/llvm/include/llvm/ADT/ImmutableSet.h
+++ b/llvm/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; }
};
OpenPOWER on IntegriCloud