Add getter methods for the extremes of a ConstantRange.
[oota-llvm.git] / lib / Support / Allocator.cpp
index a31b80fcf355e698b55d98092e8693b3a1747213..234fd41b73832199fc1d6b4c0aa510570ce073b9 100644 (file)
@@ -93,7 +93,10 @@ BumpPtrAllocator::~BumpPtrAllocator() {
 }
 
 void *BumpPtrAllocator::Allocate(unsigned Size, unsigned Align) {
-  return ((MemRegion*)TheMemory)->Allocate(Size, Align,(MemRegion**)&TheMemory);
+  MemRegion *MRP = (MemRegion*)TheMemory;
+  void *Ptr = MRP->Allocate(Size, Align, &MRP);
+  TheMemory = MRP;
+  return Ptr;
 }
 
 void BumpPtrAllocator::PrintStats() const {