[llvm-commits] [llvm] r99883 - in /llvm/trunk: include/llvm/CodeGen/LiveInterval.h include/llvm/Support/Allocator.h lib/CodeGen/LiveInterval.cpp lib/CodeGen/LiveIntervalAnalysis.cpp lib/Support/Allocator.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Mar 30 12:46:43 PDT 2010


On Mar 30, 2010, at 12:17 PM, Benjamin Kramer wrote:

> 
> On 30.03.2010, at 19:00, Jakob Stoklund Olesen wrote:
> 
>> 
>> On Mar 30, 2010, at 9:49 AM, Török Edwin wrote:
>> 
>>> On 03/30/2010 07:32 PM, Jakob Stoklund Olesen wrote:
>> 
>>>> A template class that is only capable of allocating one type would be safer.
>>> 
>>> Sounds good, the template could automatically call the destructor when
>>> Reset() is called, without the need for the special Reset() method.
> 
> I quickly put together a patch that adds a templated BumpPtrAllocator and allocates all VNInfos through it.
> 
> <specificbumpallocator.patch>

Looks good to me, thanks!

I would rename Reset() to something more ominous, like DestroyAll().

+  void Deallocate(const T *Ptr) {
+    Ptr->~T();
+  }

Is that one necessary? If you are going to destroy single elements, you should not be using this class in the first place.

/jakob





More information about the llvm-commits mailing list