[llvm-commits] [llvm] r100766 - in /llvm/trunk/include/llvm/Support: Allocator.h RecyclingAllocator.h

Benjamin Kramer benny.kra at googlemail.com
Thu Apr 8 08:22:35 PDT 2010


Author: d0k
Date: Thu Apr  8 10:22:35 2010
New Revision: 100766

URL: http://llvm.org/viewvc/llvm-project?rev=100766&view=rev
Log:
Provide operator delete for BumpPtrAllocator and RecyclingAllocator. They will
never be called but msvc complains that they're missing.

Modified:
    llvm/trunk/include/llvm/Support/Allocator.h
    llvm/trunk/include/llvm/Support/RecyclingAllocator.h

Modified: llvm/trunk/include/llvm/Support/Allocator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Allocator.h?rev=100766&r1=100765&r2=100766&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Allocator.h (original)
+++ llvm/trunk/include/llvm/Support/Allocator.h Thu Apr  8 10:22:35 2010
@@ -236,4 +236,6 @@
                                            offsetof(S, x)));
 }
 
+inline void operator delete(void *, llvm::BumpPtrAllocator &) {}
+
 #endif // LLVM_SUPPORT_ALLOCATOR_H

Modified: llvm/trunk/include/llvm/Support/RecyclingAllocator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/RecyclingAllocator.h?rev=100766&r1=100765&r2=100766&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/RecyclingAllocator.h (original)
+++ llvm/trunk/include/llvm/Support/RecyclingAllocator.h Thu Apr  8 10:22:35 2010
@@ -63,4 +63,11 @@
   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





More information about the llvm-commits mailing list