From 180c3d4edd1219832be8f2cf91f5f73f9757c36f Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 8 Apr 2010 15:22:35 +0000 Subject: [PATCH] Provide operator delete for BumpPtrAllocator and RecyclingAllocator. They will 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 | 2 ++ include/llvm/Support/RecyclingAllocator.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index 148d47e785c..4a7251fa1ef 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -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 diff --git a/include/llvm/Support/RecyclingAllocator.h b/include/llvm/Support/RecyclingAllocator.h index 49f77537188..34ab874778c 100644 --- a/include/llvm/Support/RecyclingAllocator.h +++ b/include/llvm/Support/RecyclingAllocator.h @@ -63,4 +63,11 @@ inline void *operator new(size_t, return Allocator.Allocate(); } +template +inline void operator delete(void *E, + llvm::RecyclingAllocator &A) { + A.Deallocate(E); +} + #endif -- 2.11.0