Provide operator delete for BumpPtrAllocator and RecyclingAllocator. They will
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 8 Apr 2010 15:22:35 +0000 (15:22 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 8 Apr 2010 15:22:35 +0000 (15:22 +0000)
never be called but msvc complains that they're missing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100766 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Allocator.h
include/llvm/Support/RecyclingAllocator.h

index 148d47e785c7c6c2a2be3f4c770e989398a5638e..4a7251fa1ef334069f403fccbe2ac87573072e18 100644 (file)
@@ -236,4 +236,6 @@ inline void *operator new(size_t Size, llvm::BumpPtrAllocator &Allocator) {
                                            offsetof(S, x)));
 }
 
+inline void operator delete(void *, llvm::BumpPtrAllocator &) {}
+
 #endif // LLVM_SUPPORT_ALLOCATOR_H
index 49f77537188d9e63ba3baae708041c6ea5b2be80..34ab874778c912bc7fba98459c5fd0f189138509 100644 (file)
@@ -63,4 +63,11 @@ inline void *operator new(size_t,
   return Allocator.Allocate();
 }
 
+template<class AllocatorType, class T, size_t Size, size_t Align>
+inline void operator delete(void *E,
+                            llvm::RecyclingAllocator<AllocatorType,
+                                                     T, Size, Align> &A) {
+  A.Deallocate(E);
+}
+
 #endif