summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-10-17 22:17:01 +0000
committerTed Kremenek <kremenek@apple.com>2007-10-17 22:17:01 +0000
commit603fbbfcb74e68c7ba91bd61cd251cb9de63652b (patch)
tree7ff7dd0080481775cae8471f9d4e8e4ce0e59f9b
parent3830606dee158e04a04df92c6f6e17f317c62b4c (diff)
downloadbcm5719-llvm-603fbbfcb74e68c7ba91bd61cd251cb9de63652b.tar.gz
bcm5719-llvm-603fbbfcb74e68c7ba91bd61cd251cb9de63652b.zip
ImutAVLTree now allocates tree nodes from the BumpPtrAllocator using
the new type-aligned Allocate() method. llvm-svn: 43100
-rw-r--r--llvm/include/llvm/ADT/ImmutableSet.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/include/llvm/ADT/ImmutableSet.h b/llvm/include/llvm/ADT/ImmutableSet.h
index 3ff6571481a..0210f27b895 100644
--- a/llvm/include/llvm/ADT/ImmutableSet.h
+++ b/llvm/include/llvm/ADT/ImmutableSet.h
@@ -373,12 +373,11 @@ private:
assert (InsertPos != NULL);
- // FIXME: more intelligent calculation of alignment.
- TreeTy* T = (TreeTy*) Allocator.Allocate(sizeof(*T),16);
-
+ // Allocate the new tree node and insert it into the cache.
+ TreeTy* T = Allocator.Allocate<TreeTy>();
new (T) TreeTy(L,R,V,IncrementHeight(L,R));
-
Cache.InsertNode(T,InsertPos);
+
return T;
}
OpenPOWER on IntegriCloud