llvm.org GIT mirror llvm / fc601db
Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164014 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 7 years ago
12 changed file(s) with 30 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
3232
3333 friend class ImmutableListFactory;
3434
35 // Do not implement.
36 void operator=(const ImmutableListImpl&);
37 ImmutableListImpl(const ImmutableListImpl&);
35 void operator=(const ImmutableListImpl&) LLVM_DELETED_FUNCTION;
36 ImmutableListImpl(const ImmutableListImpl&) LLVM_DELETED_FUNCTION;
3837
3938 public:
4039 const T& getHead() const { return Head; }
121121 }
122122
123123 private:
124 Factory(const Factory& RHS); // DO NOT IMPLEMENT
125 void operator=(const Factory& RHS); // DO NOT IMPLEMENT
124 Factory(const Factory& RHS) LLVM_DELETED_FUNCTION;
125 void operator=(const Factory& RHS) LLVM_DELETED_FUNCTION;
126126 };
127127
128128 bool contains(key_type_ref K) const {
10061006 }
10071007
10081008 private:
1009 Factory(const Factory& RHS); // DO NOT IMPLEMENT
1010 void operator=(const Factory& RHS); // DO NOT IMPLEMENT
1009 Factory(const Factory& RHS) LLVM_DELETED_FUNCTION;
1010 void operator=(const Factory& RHS) LLVM_DELETED_FUNCTION;
10111011 };
10121012
10131013 friend class Factory;
1313 #ifndef LLVM_ADT_OWNING_PTR_H
1414 #define LLVM_ADT_OWNING_PTR_H
1515
16 #include "llvm/Support/Compiler.h"
1617 #include
1718 #include
1819
2425 /// pointee object can be taken away from OwningPtr by using the take method.
2526 template
2627 class OwningPtr {
27 OwningPtr(OwningPtr const &); // DO NOT IMPLEMENT
28 OwningPtr &operator=(OwningPtr const &); // DO NOT IMPLEMENT
28 OwningPtr(OwningPtr const &) LLVM_DELETED_FUNCTION;
29 OwningPtr &operator=(OwningPtr const &) LLVM_DELETED_FUNCTION;
2930 T *Ptr;
3031 public:
3132 explicit OwningPtr(T *P = 0) : Ptr(P) {}
7879 /// functionality as OwningPtr, except that it works for array types.
7980 template
8081 class OwningArrayPtr {
81 OwningArrayPtr(OwningArrayPtr const &); // DO NOT IMPLEMENT
82 OwningArrayPtr &operator=(OwningArrayPtr const &); // DO NOT IMPLEMENT
82 OwningArrayPtr(OwningArrayPtr const &) LLVM_DELETED_FUNCTION;
83 OwningArrayPtr &operator=(OwningArrayPtr const &) LLVM_DELETED_FUNCTION;
8384 T *Ptr;
8485 public:
8586 explicit OwningArrayPtr(T *P = 0) : Ptr(P) {}
8989 /// LastValInScope - This is the last value that was inserted for this scope
9090 /// or null if none have been inserted yet.
9191 ScopedHashTableVal *LastValInScope;
92 void operator=(ScopedHashTableScope&); // DO NOT IMPLEMENT
93 ScopedHashTableScope(ScopedHashTableScope&); // DO NOT IMPLEMENT
92 void operator=(ScopedHashTableScope&) LLVM_DELETED_FUNCTION;
93 ScopedHashTableScope(ScopedHashTableScope&) LLVM_DELETED_FUNCTION;
9494 public:
9595 ScopedHashTableScope(ScopedHashTable &HT);
9696 ~ScopedHashTableScope();
127127
128128 // Disable copy construction and assignment.
129129 // This data structure is not meant to be used that way.
130 SparseSet(const SparseSet&); // DO NOT IMPLEMENT.
131 SparseSet &operator=(const SparseSet&); // DO NOT IMPLEMENT.
130 SparseSet(const SparseSet&) LLVM_DELETED_FUNCTION;
131 SparseSet &operator=(const SparseSet&) LLVM_DELETED_FUNCTION;
132132
133133 public:
134134 typedef ValueT value_type;
7979 typedef typename Config::ExtraData ExtraData;
8080 MapT Map;
8181 ExtraData Data;
82 ValueMap(const ValueMap&); // DO NOT IMPLEMENT
83 ValueMap& operator=(const ValueMap&); // DO NOT IMPLEMENT
82 ValueMap(const ValueMap&) LLVM_DELETED_FUNCTION;
83 ValueMap& operator=(const ValueMap&) LLVM_DELETED_FUNCTION;
8484 public:
8585 typedef KeyT key_type;
8686 typedef ValueT mapped_type;
3737 #ifndef LLVM_ADT_ILIST_H
3838 #define LLVM_ADT_ILIST_H
3939
40 #include "llvm/Support/Compiler.h"
4041 #include
4142 #include
4243 #include
330331
331332 // No fundamental reason why iplist can't be copyable, but the default
332333 // copy/copy-assign won't do.
333 iplist(const iplist &); // do not implement
334 void operator=(const iplist &); // do not implement
334 iplist(const iplist &) LLVM_DELETED_FUNCTION;
335 void operator=(const iplist &) LLVM_DELETED_FUNCTION;
335336
336337 public:
337338 typedef NodeTy *pointer;
7777 ~FileOutputBuffer();
7878
7979
80 private:
81 FileOutputBuffer(const FileOutputBuffer &) LLVM_DELETED_FUNCTION;
82 FileOutputBuffer &operator=(const FileOutputBuffer &) LLVM_DELETED_FUNCTION;
8083 protected:
81 FileOutputBuffer(const FileOutputBuffer &); // DO NOT IMPLEMENT
82 FileOutputBuffer &operator=(const FileOutputBuffer &); // DO NOT IMPLEMENT
83 FileOutputBuffer(uint8_t *Start, uint8_t *End,
84 FileOutputBuffer(uint8_t *Start, uint8_t *End,
8485 StringRef Path, StringRef TempPath);
8586
8687 uint8_t *BufferStart;
2525 /// @brief Guard a section of code with a Mutex.
2626 class MutexGuard {
2727 sys::Mutex &M;
28 MutexGuard(const MutexGuard &); // DO NOT IMPLEMENT
29 void operator=(const MutexGuard &); // DO NOT IMPLEMENT
28 MutexGuard(const MutexGuard &) LLVM_DELETED_FUNCTION;
29 void operator=(const MutexGuard &) LLVM_DELETED_FUNCTION;
3030 public:
3131 MutexGuard(sys::Mutex &m) : M(m) { M.acquire(); }
3232 ~MutexGuard() { M.release(); }
3636 /// is necessary to define an alternate traits class.
3737 template
3838 class RegistryTraits {
39 RegistryTraits(); // Do not implement.
39 RegistryTraits() LLVM_DELETED_FUNCTION;
4040
4141 public:
4242 typedef SimpleRegistryEntry entry;
6262 class iterator;
6363
6464 private:
65 Registry(); // Do not implement.
65 Registry() LLVM_DELETED_FUNCTION;
6666
6767 static void Announce(const entry &E) {
6868 for (listener *Cur = ListenerHead; Cur; Cur = Cur->Next)
5858 // pair. The 'setValPtrInt' and 'getValPtrInt' methods below give them this
5959 // access.
6060 PointerIntPair VP;
61
62 explicit ValueHandleBase(const ValueHandleBase&); // DO NOT IMPLEMENT.
61
62 ValueHandleBase(const ValueHandleBase&) LLVM_DELETED_FUNCTION;
6363 public:
6464 explicit ValueHandleBase(HandleBaseKind Kind)
6565 : PrevPair(0, Kind), Next(0), VP(0, 0) {}