summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-10-18 00:30:14 +0000
committerTed Kremenek <kremenek@apple.com>2007-10-18 00:30:14 +0000
commit52e2d83e653abd745d93bc05acba59c32a64eabf (patch)
tree655879e05069a8676393bf2140c1235c58674a77 /include
parentafa222c8950a79a6e38a68c095ce1c547773501b (diff)
downloadllvm-52e2d83e653abd745d93bc05acba59c32a64eabf.tar.gz
llvm-52e2d83e653abd745d93bc05acba59c32a64eabf.tar.bz2
llvm-52e2d83e653abd745d93bc05acba59c32a64eabf.tar.xz
Changed the return type of type-specific Allocate() methods to return
void*. This is hint that we are returning uninitialized memory rather than a constructed object. Patched ImutAVLTree to conform to this new interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/ImmutableSet.h2
-rw-r--r--include/llvm/Support/Allocator.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h
index 0210f27b89..c33717a124 100644
--- a/include/llvm/ADT/ImmutableSet.h
+++ b/include/llvm/ADT/ImmutableSet.h
@@ -374,7 +374,7 @@ private:
assert (InsertPos != NULL);
// Allocate the new tree node and insert it into the cache.
- TreeTy* T = Allocator.Allocate<TreeTy>();
+ TreeTy* T = (TreeTy*) Allocator.Allocate<TreeTy>();
new (T) TreeTy(L,R,V,IncrementHeight(L,R));
Cache.InsertNode(T,InsertPos);
diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h
index 397cf0c7c2..729cc674a8 100644
--- a/include/llvm/Support/Allocator.h
+++ b/include/llvm/Support/Allocator.h
@@ -28,7 +28,7 @@ public:
void *Allocate(unsigned Size, unsigned Alignment) { return malloc(Size); }
template <typename T>
- T* Allocate() { return reinterpret_cast<T*>(malloc(sizeof(T))); }
+ void *Allocate() { return reinterpret_cast<T*>(malloc(sizeof(T))); }
void Deallocate(void *Ptr) { free(Ptr); }
void PrintStats() const {}
@@ -48,7 +48,7 @@ public:
void *Allocate(unsigned Size, unsigned Alignment);
template <typename T>
- T* Allocate() {
+ void *Allocate() {
return reinterpret_cast<T*>(Allocate(sizeof(T),AlignOf<T>::Alignment));
}