summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-03-30 20:16:45 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-03-30 20:16:45 +0000
commit04c713dd4515087eccbc1c57677a8bbeebb67e35 (patch)
treeca1c585c5c0da86af0605f5ade32c4374004d37a /llvm/lib/Support
parent921e80b1f59fa84e7b9f877716f88dd87d3a0966 (diff)
downloadbcm5719-llvm-04c713dd4515087eccbc1c57677a8bbeebb67e35.tar.gz
bcm5719-llvm-04c713dd4515087eccbc1c57677a8bbeebb67e35.zip
Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allows
only a single type of object to be allocated. Use it to make VNInfo destruction typesafe. llvm-svn: 99919
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Allocator.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/llvm/lib/Support/Allocator.cpp b/llvm/lib/Support/Allocator.cpp
index 7433247c237..31b45c8d4aa 100644
--- a/llvm/lib/Support/Allocator.cpp
+++ b/llvm/lib/Support/Allocator.cpp
@@ -78,21 +78,6 @@ void BumpPtrAllocator::Reset() {
End = ((char*)CurSlab) + CurSlab->Size;
}
-void BumpPtrAllocator::Reset(size_t Size, size_t Alignment, DTorFunction DTor) {
- if (Alignment == 0) Alignment = 1;
- MemSlab *Slab = CurSlab;
- while (Slab) {
- char *End = Slab == CurSlab ? CurPtr : (char*)Slab + Slab->Size;
- for (char *Ptr = (char*)Slab+1; Ptr < End; Ptr += Size) {
- Ptr = AlignPtr(Ptr, Alignment);
- if (Ptr + Size <= End)
- DTor(Ptr);
- }
- Slab = Slab->NextPtr;
- }
- Reset();
-}
-
/// Allocate - Allocate space at the specified alignment.
///
void *BumpPtrAllocator::Allocate(size_t Size, size_t Alignment) {
OpenPOWER on IntegriCloud