Add a function to check if an argument list is too long.
[oota-llvm.git] / include / llvm / Support / Allocator.h
index c2dd75d48834a9fd2d92aae945f5480c0f06709e..3243fd9cea57ecc8e18de21f118448069d2367b8 100644 (file)
 #define LLVM_SUPPORT_ALLOCATOR_H
 
 #include "llvm/Support/AlignOf.h"
-#include "llvm/Support/MathExtras.h"
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/MathExtras.h"
 #include <algorithm>
 #include <cassert>
-#include <cstdlib>
 #include <cstddef>
+#include <cstdlib>
 
 namespace llvm {
 template <typename T> struct ReferenceAdder { typedef T& result; };
@@ -79,8 +79,8 @@ class MallocSlabAllocator : public SlabAllocator {
 public:
   MallocSlabAllocator() : Allocator() { }
   virtual ~MallocSlabAllocator();
-  virtual MemSlab *Allocate(size_t Size);
-  virtual void Deallocate(MemSlab *Slab);
+  virtual MemSlab *Allocate(size_t Size) LLVM_OVERRIDE;
+  virtual void Deallocate(MemSlab *Slab) LLVM_OVERRIDE;
 };
 
 /// BumpPtrAllocator - This allocator is useful for containers that need
@@ -88,8 +88,8 @@ public:
 /// allocating memory, and never deletes it until the entire block is dead. This
 /// makes allocation speedy, but must only be used when the trade-off is ok.
 class BumpPtrAllocator {
-  BumpPtrAllocator(const BumpPtrAllocator &); // do not implement
-  void operator=(const BumpPtrAllocator &);   // do not implement
+  BumpPtrAllocator(const BumpPtrAllocator &) LLVM_DELETED_FUNCTION;
+  void operator=(const BumpPtrAllocator &) LLVM_DELETED_FUNCTION;
 
   /// SlabSize - Allocate data into slabs of this size unless we get an
   /// allocation above SizeThreshold.
@@ -239,21 +239,4 @@ inline void *operator new(size_t Size, llvm::BumpPtrAllocator &Allocator) {
 
 inline void operator delete(void *, llvm::BumpPtrAllocator &) {}
 
-inline void *operator new[](size_t Size, llvm::BumpPtrAllocator &Allocator) {
-  struct S {
-    char c;
-    union {
-      double D;
-      long double LD;
-      long long L;
-      void *P;
-    } x;
-  };
-  return Allocator.Allocate(Size, std::min((size_t)llvm::NextPowerOf2(Size),
-                                           offsetof(S, x)));
-}
-
-inline void operator delete[](void *Ptr, llvm::BumpPtrAllocator &C, size_t) {
-}
-
 #endif // LLVM_SUPPORT_ALLOCATOR_H