Add methods to StringMap to erase entries by key.
[oota-llvm.git] / lib / Support / Allocator.cpp
index 8ccd3908446a4a47ecf96f49d49bdecb09bef673..ba6a393c81fc9b1778a6b372e97e41709c2f641b 100644 (file)
@@ -45,10 +45,10 @@ public:
   
   /// Allocate - Allocate and return at least the specified number of bytes.
   ///
-  void *Allocate(unsigned AllocSize, unsigned Alignment, MemRegion **RegPtr) {
+  void *Allocate(size_t AllocSize, size_t Alignment, MemRegion **RegPtr) {
     
     char* Result = (char*) (((uintptr_t) (NextPtr+Alignment-1)) 
-                            & ~(Alignment-1));
+                            & ~((uintptr_t) Alignment-1));
 
     // Speculate the new value of NextPtr.
     char* NextPtrTmp = Result + AllocSize;
@@ -113,7 +113,7 @@ void BumpPtrAllocator::Reset() {
   TheMemory = MRP;
 }
 
-void *BumpPtrAllocator::Allocate(unsigned Size, unsigned Align) {
+void *BumpPtrAllocator::Allocate(size_t Size, size_t Align) {
   MemRegion *MRP = (MemRegion*)TheMemory;
   void *Ptr = MRP->Allocate(Size, Align, &MRP);
   TheMemory = MRP;