mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
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
This commit is contained in:
@@ -201,17 +201,16 @@ private:
|
|||||||
|
|
||||||
static inline
|
static inline
|
||||||
void Profile(FoldingSetNodeID& ID, ImutAVLTree* L, ImutAVLTree* R,
|
void Profile(FoldingSetNodeID& ID, ImutAVLTree* L, ImutAVLTree* R,
|
||||||
unsigned H, value_type_ref V) {
|
value_type_ref V) {
|
||||||
ID.AddPointer(L);
|
ID.AddPointer(L);
|
||||||
ID.AddPointer(R);
|
ID.AddPointer(R);
|
||||||
ID.AddInteger(H);
|
|
||||||
ImutInfo::Profile(ID,V);
|
ImutInfo::Profile(ID,V);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void Profile(FoldingSetNodeID& ID) {
|
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) {
|
TreeTy* CreateNode(TreeTy* L, value_type_ref V, TreeTy* R) {
|
||||||
FoldingSetNodeID ID;
|
FoldingSetNodeID ID;
|
||||||
unsigned height = IncrementHeight(L,R);
|
TreeTy::Profile(ID,L,R,V);
|
||||||
|
|
||||||
TreeTy::Profile(ID,L,R,height,V);
|
|
||||||
void* InsertPos;
|
void* InsertPos;
|
||||||
|
|
||||||
if (TreeTy* T = Cache.FindNodeOrInsertPos(ID,InsertPos))
|
if (TreeTy* T = Cache.FindNodeOrInsertPos(ID,InsertPos))
|
||||||
@@ -356,7 +353,7 @@ private:
|
|||||||
|
|
||||||
// FIXME: more intelligent calculation of alignment.
|
// FIXME: more intelligent calculation of alignment.
|
||||||
TreeTy* T = (TreeTy*) Allocator.Allocate(sizeof(*T),16);
|
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);
|
Cache.InsertNode(T,InsertPos);
|
||||||
return T;
|
return T;
|
||||||
|
Reference in New Issue
Block a user