[llvm-commits] CVS: llvm/lib/Support/Allocator.cpp

Chris Lattner sabre at nondot.org
Fri Feb 23 14:31:49 PST 2007



Changes in directory llvm/lib/Support:

Allocator.cpp updated: 1.5 -> 1.6
---
Log message:

Avoid TBAA issue.


---
Diffs of the changes:  (+4 -1)

 Allocator.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/Support/Allocator.cpp
diff -u llvm/lib/Support/Allocator.cpp:1.5 llvm/lib/Support/Allocator.cpp:1.6
--- llvm/lib/Support/Allocator.cpp:1.5	Thu Dec  7 17:41:45 2006
+++ llvm/lib/Support/Allocator.cpp	Fri Feb 23 16:31:24 2007
@@ -93,7 +93,10 @@
 }
 
 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 {






More information about the llvm-commits mailing list