aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/ImmutableSet.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-10-10 23:32:01 +0000
committerTed Kremenek <kremenek@apple.com>2007-10-10 23:32:01 +0000
commit7e6d437a944909ef224b65dd1b74f7a55d7a16a5 (patch)
treec213c8c0dffbf02cea7d69b839882171fbf24b76 /include/llvm/ADT/ImmutableSet.h
parent6100e7f67aedac6ac13dc98437e89b68f2b53c2e (diff)
downloadexternal_llvm-7e6d437a944909ef224b65dd1b74f7a55d7a16a5.zip
external_llvm-7e6d437a944909ef224b65dd1b74f7a55d7a16a5.tar.gz
external_llvm-7e6d437a944909ef224b65dd1b74f7a55d7a16a5.tar.bz2
Removed "height" of an AVL tree node from its Profile. This is
implicitly captured by using the addresses of its children in the profile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42847 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/ImmutableSet.h')
-rw-r--r--include/llvm/ADT/ImmutableSet.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h
index 64d626d..31f4cb0 100644
--- a/include/llvm/ADT/ImmutableSet.h
+++ b/include/llvm/ADT/ImmutableSet.h
@@ -201,17 +201,16 @@ private:
static inline
void Profile(FoldingSetNodeID& ID, ImutAVLTree* L, ImutAVLTree* R,
- unsigned H, value_type_ref V) {
+ value_type_ref V) {
ID.AddPointer(L);
ID.AddPointer(R);
- ID.AddInteger(H);
ImutInfo::Profile(ID,V);
}
public:
void Profile(FoldingSetNodeID& ID) {
- Profile(ID,getSafeLeft(),getRight(),getHeight(),getValue());
+ Profile(ID,getSafeLeft(),getRight(),getValue());
}
//===----------------------------------------------------===//
@@ -344,9 +343,7 @@ private:
TreeTy* CreateNode(TreeTy* L, value_type_ref V, TreeTy* R) {
FoldingSetNodeID ID;
- unsigned height = IncrementHeight(L,R);
-
- TreeTy::Profile(ID,L,R,height,V);
+ TreeTy::Profile(ID,L,R,V);
void* InsertPos;
if (TreeTy* T = Cache.FindNodeOrInsertPos(ID,InsertPos))
@@ -356,7 +353,7 @@ private:
// FIXME: more intelligent calculation of alignment.
TreeTy* T = (TreeTy*) Allocator.Allocate(sizeof(*T),16);
- new (T) TreeTy(L,R,V,height);
+ new (T) TreeTy(L,R,V,IncrementHeight(L,R));
Cache.InsertNode(T,InsertPos);
return T;