[llvm-commits] [llvm] r42847 - /llvm/trunk/include/llvm/ADT/ImmutableSet.h
Ted Kremenek
kremenek at apple.com
Wed Oct 10 16:32:01 PDT 2007
Author: kremenek
Date: Wed Oct 10 18:32:01 2007
New Revision: 42847
URL: http://llvm.org/viewvc/llvm-project?rev=42847&view=rev
Log:
Removed "height" of an AVL tree node from its Profile. This is
implicitly captured by using the addresses of its children in the
profile.
Modified:
llvm/trunk/include/llvm/ADT/ImmutableSet.h
Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=42847&r1=42846&r2=42847&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Wed Oct 10 18:32:01 2007
@@ -201,17 +201,16 @@
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 @@
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 @@
// 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;
More information about the llvm-commits
mailing list