Skip to content

Commit 7124b45

Browse files
Fixed -Wdeprecated-copy warnings. NFCI.
1 parent 79e2325 commit 7124b45

File tree

11 files changed

+39
-4
lines changed

11 files changed

+39
-4
lines changed

clang/include/clang/AST/ASTImporter.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ class TypeSourceInfo;
6060

6161
static char ID;
6262

63-
ImportError() : Error(Unknown) { }
64-
ImportError(const ImportError &Other) : Error(Other.Error) { }
63+
ImportError() : Error(Unknown) {}
64+
ImportError(const ImportError &Other) : Error(Other.Error) {}
65+
ImportError &operator=(const ImportError &Other) {
66+
Error = Other.Error;
67+
return *this,
68+
}
6569
ImportError(ErrorKind Error) : Error(Error) { }
6670

6771
std::string toString() const;

clang/include/clang/Sema/ObjCMethodList.h

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ struct ObjCMethodList {
3636
: MethodAndHasMoreThanOneDecl(L.MethodAndHasMoreThanOneDecl),
3737
NextAndExtraBits(L.NextAndExtraBits) {}
3838

39+
ObjCMethodList &operator=(const ObjCMethodList &L) {
40+
MethodAndHasMoreThanOneDecl = L.MethodAndHasMoreThanOneDecl;
41+
NextAndExtraBits = L.NextAndExtraBits;
42+
return *this;
43+
}
44+
3945
ObjCMethodList *getNext() const { return NextAndExtraBits.getPointer(); }
4046
unsigned getBits() const { return NextAndExtraBits.getInt(); }
4147
void setNext(ObjCMethodList *L) { NextAndExtraBits.setPointer(L); }

llvm/include/llvm/ADT/STLExtras.h

+3
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,8 @@ template <typename R> struct result_pair {
14151415
result_pair(std::size_t Index, IterOfRange<R> Iter)
14161416
: Index(Index), Iter(Iter) {}
14171417

1418+
result_pair<R>(const result_pair<R> &Other)
1419+
: Index(Other.Index), Iter(Other.Iter) {}
14181420
result_pair<R> &operator=(const result_pair<R> &Other) {
14191421
Index = Other.Index;
14201422
Iter = Other.Iter;
@@ -1463,6 +1465,7 @@ class enumerator_iter
14631465
return Result.Iter == RHS.Result.Iter;
14641466
}
14651467

1468+
enumerator_iter<R>(const enumerator_iter<R> &Other) : Result(Other.Result) {}
14661469
enumerator_iter<R> &operator=(const enumerator_iter<R> &Other) {
14671470
Result = Other.Result;
14681471
return *this;

llvm/include/llvm/DebugInfo/PDB/Native/DbiModuleList.h

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class DbiModuleSourceFilesIterator
3939
DbiModuleSourceFilesIterator(const DbiModuleList &Modules, uint32_t Modi,
4040
uint16_t Filei);
4141
DbiModuleSourceFilesIterator() = default;
42+
DbiModuleSourceFilesIterator(const DbiModuleSourceFilesIterator &R) = default;
4243
DbiModuleSourceFilesIterator &
4344
operator=(const DbiModuleSourceFilesIterator &R) = default;
4445

llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class HashTableIterator
5656
}
5757
}
5858

59+
HashTableIterator(const HashTableIterator &R) : Map(R.Map) {}
5960
HashTableIterator &operator=(const HashTableIterator &R) {
6061
Map = R.Map;
6162
return *this;

llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h

+1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ struct DiagnosticPredicate {
174174
: DiagnosticPredicateTy::NearMatch) {}
175175
DiagnosticPredicate(DiagnosticPredicateTy T) : Type(T) {}
176176
DiagnosticPredicate(const DiagnosticPredicate &) = default;
177+
DiagnosticPredicate& operator=(const DiagnosticPredicate &) = default;
177178

178179
operator bool() const { return Type == DiagnosticPredicateTy::Match; }
179180
bool isMatch() const { return Type == DiagnosticPredicateTy::Match; }

llvm/include/llvm/Support/BinaryStreamArray.h

+3
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ template <typename T> class FixedStreamArray {
274274
return !(*this == Other);
275275
}
276276

277+
FixedStreamArray(const FixedStreamArray &) = default;
277278
FixedStreamArray &operator=(const FixedStreamArray &) = default;
278279

279280
const T &operator[](uint32_t Index) const {
@@ -323,6 +324,8 @@ class FixedStreamArrayIterator
323324
FixedStreamArrayIterator(const FixedStreamArray<T> &Array, uint32_t Index)
324325
: Array(Array), Index(Index) {}
325326

327+
FixedStreamArrayIterator<T>(const FixedStreamArrayIterator<T> &Other)
328+
: Array(Other.Array), Index(Other.Index) {}
326329
FixedStreamArrayIterator<T> &
327330
operator=(const FixedStreamArrayIterator<T> &Other) {
328331
Array = Other.Array;

llvm/include/llvm/Support/Timer.h

+1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class TimerGroup {
174174
std::string Description;
175175

176176
PrintRecord(const PrintRecord &Other) = default;
177+
PrintRecord &operator=(const PrintRecord &Other) = default;
177178
PrintRecord(const TimeRecord &Time, const std::string &Name,
178179
const std::string &Description)
179180
: Time(Time), Name(Name), Description(Description) {}

llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,21 @@ namespace {
134134
uint32_t properties() const;
135135
unsigned size() const { return Size; }
136136

137-
LatticeCell &operator= (const LatticeCell &L) {
137+
LatticeCell(const LatticeCell &L) {
138+
// This memcpy also copies Properties (when L.Size == 0).
139+
uint32_t N =
140+
L.IsSpecial ? sizeof L.Properties : L.Size * sizeof(const Constant *);
141+
memcpy(Values, L.Values, N);
142+
Kind = L.Kind;
143+
Size = L.Size;
144+
IsSpecial = L.IsSpecial;
145+
}
146+
147+
LatticeCell &operator=(const LatticeCell &L) {
138148
if (this != &L) {
139149
// This memcpy also copies Properties (when L.Size == 0).
140150
uint32_t N = L.IsSpecial ? sizeof L.Properties
141-
: L.Size*sizeof(const Constant*);
151+
: L.Size * sizeof(const Constant *);
142152
memcpy(Values, L.Values, N);
143153
Kind = L.Kind;
144154
Size = L.Size;

llvm/lib/Target/Hexagon/HexagonGenInsert.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ namespace {
9393
RegisterSet() = default;
9494
explicit RegisterSet(unsigned s, bool t = false) : BitVector(s, t) {}
9595
RegisterSet(const RegisterSet &RS) : BitVector(RS) {}
96+
RegisterSet &operator=(const RegisterSet &RS) {
97+
BitVector::operator=(RS);
98+
return *this;
99+
}
96100

97101
using BitVector::clear;
98102

llvm/utils/TableGen/CodeGenDAGPatterns.h

+1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ struct TypeSetByHwMode : public InfoByHwMode<MachineValueTypeSet> {
194194

195195
TypeSetByHwMode() = default;
196196
TypeSetByHwMode(const TypeSetByHwMode &VTS) = default;
197+
TypeSetByHwMode &operator=(const TypeSetByHwMode &) = default;
197198
TypeSetByHwMode(MVT::SimpleValueType VT)
198199
: TypeSetByHwMode(ValueTypeByHwMode(VT)) {}
199200
TypeSetByHwMode(ValueTypeByHwMode VT)

0 commit comments

Comments
 (0)