diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h index 0210f27b895..c33717a1242 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* T = (TreeTy*) Allocator.Allocate(); 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 397cf0c7c2e..729cc674a8c 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 - T* Allocate() { return reinterpret_cast(malloc(sizeof(T))); } + void *Allocate() { return reinterpret_cast(malloc(sizeof(T))); } void Deallocate(void *Ptr) { free(Ptr); } void PrintStats() const {} @@ -48,7 +48,7 @@ public: void *Allocate(unsigned Size, unsigned Alignment); template - T* Allocate() { + void *Allocate() { return reinterpret_cast(Allocate(sizeof(T),AlignOf::Alignment)); }