Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allows
only a single type of object to be allocated. Use it to make VNInfo destruction
typesafe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99919 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 53366b9..23cff07 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -82,11 +82,6 @@
   MachineFunctionPass::getAnalysisUsage(AU);
 }
 
-static void VNInfoDTor(void* Ptr)
-{
-   reinterpret_cast<VNInfo*>(Ptr)->~VNInfo();
-}
-
 void LiveIntervals::releaseMemory() {
   // Free the live intervals themselves.
   for (DenseMap<unsigned, LiveInterval*>::iterator I = r2iMap_.begin(),
@@ -96,7 +91,7 @@
   r2iMap_.clear();
 
   // Release VNInfo memroy regions after all VNInfo objects are dtor'd.
-  VNInfoAllocator.Reset((unsigned)sizeof(VNInfo), alignof<VNInfo>(), VNInfoDTor);
+  VNInfoAllocator.DestroyAll();
   while (!CloneMIs.empty()) {
     MachineInstr *MI = CloneMIs.back();
     CloneMIs.pop_back();