diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index 33cdca13e64..14211488a59 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -25,12 +25,14 @@ public: ~MallocAllocator() {} void Reset() {} + void *Allocate(size_t Size, size_t Alignment) { return malloc(Size); } template - void *Allocate() { return reinterpret_cast(malloc(sizeof(T))); } + T *Allocate() { return static_cast(malloc(sizeof(T))); } void Deallocate(void *Ptr) { free(Ptr); } + void PrintStats() const {} }; @@ -45,15 +47,16 @@ public: ~BumpPtrAllocator(); void Reset(); + void *Allocate(size_t Size, size_t Alignment); template - void *Allocate() { - return reinterpret_cast(Allocate(sizeof(T),AlignOf::Alignment)); + T *Allocate() { + return static_cast(Allocate(sizeof(T),AlignOf::Alignment)); } - void Deallocate(void *Ptr) {} + void PrintStats() const; };