CrashRecovery: Add CrashRecoveryContext::GetCurrent(), so clients can find the active...
[oota-llvm.git] / include / llvm / Support / Allocator.h
index bd381807e0c6d2dfb2fea8870f4ae32c4a8f24aa..4a7251fa1ef334069f403fccbe2ac87573072e18 100644 (file)
@@ -200,9 +200,9 @@ public:
     while (Slab) {
       char *End = Slab == Allocator.CurSlab ? Allocator.CurPtr :
                                               (char *)Slab + Slab->Size;
-      for (char *Ptr = (char*)Slab+1; Ptr < End; Ptr += sizeof(T)) {
+      for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
         Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
-       if (Ptr + sizeof(T) <= End)
+        if (Ptr + sizeof(T) <= End)
           reinterpret_cast<T*>(Ptr)->~T();
       }
       Slab = Slab->NextPtr;
@@ -236,4 +236,6 @@ inline void *operator new(size_t Size, llvm::BumpPtrAllocator &Allocator) {
                                            offsetof(S, x)));
 }
 
+inline void operator delete(void *, llvm::BumpPtrAllocator &) {}
+
 #endif // LLVM_SUPPORT_ALLOCATOR_H