Revert r122114 (CallbackVH observing use-list changes) because it caused severe slowd...
[oota-llvm.git] / include / llvm / Support / Allocator.h
index eb6c2d1e25a76b3a776ec97adc82507fb0b6b569..b080e222a108181426fce6eab25664491f97cf33 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "llvm/Support/AlignOf.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/System/DataTypes.h"
+#include "llvm/Support/DataTypes.h"
 #include <algorithm>
 #include <cassert>
 #include <cstdlib>
@@ -201,8 +201,8 @@ public:
       char *End = Slab == Allocator.CurSlab ? Allocator.CurPtr :
                                               (char *)Slab + Slab->Size;
       for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
-        Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
-       if (Ptr + sizeof(T) <= End)
+        Ptr = Allocator.AlignPtr(Ptr, alignOf<T>());
+        if (Ptr + sizeof(T) <= End)
           reinterpret_cast<T*>(Ptr)->~T();
       }
       Slab = Slab->NextPtr;
@@ -221,19 +221,17 @@ public:
 inline void *operator new(size_t Size, llvm::BumpPtrAllocator &Allocator) {
   struct S {
     char c;
-#ifdef __GNUC__
-    char x __attribute__((aligned));
-#else
     union {
       double D;
       long double LD;
       long long L;
       void *P;
     } x;
-#endif
   };
   return Allocator.Allocate(Size, std::min((size_t)llvm::NextPowerOf2(Size),
                                            offsetof(S, x)));
 }
 
+inline void operator delete(void *, llvm::BumpPtrAllocator &) {}
+
 #endif // LLVM_SUPPORT_ALLOCATOR_H