Skip to content

Commit a26ef3c

Browse files
Krzysztof Parzyszektru
authored andcommitted
[Hexagon] Add defaulted operator= to classes with defaulted copy ctor
This avoids deprecation warning: ``` warning: definition of implicit copy assignment operator for 'AddrInfo' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy] ``` This fixes #57229 (cherry picked from commit 252cea0)
1 parent f1ad3ab commit a26ef3c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class AlignVectors {
149149
Align H)
150150
: Inst(I), Addr(A), ValTy(T), HaveAlign(H),
151151
NeedAlign(HVC.getTypeAlignment(ValTy)) {}
152+
AddrInfo &operator=(const AddrInfo &) = default;
152153

153154
// XXX: add Size member?
154155
Instruction *Inst;
@@ -185,6 +186,7 @@ class AlignVectors {
185186
Segment(Value *Val, int Begin, int Len)
186187
: Val(Val), Start(Begin), Size(Len) {}
187188
Segment(const Segment &Seg) = default;
189+
Segment &operator=(const Segment &Seg) = default;
188190
Value *Val; // Value representable as a sequence of bytes.
189191
int Start; // First byte of the value that belongs to the segment.
190192
int Size; // Number of bytes in the segment.
@@ -195,6 +197,7 @@ class AlignVectors {
195197
Block(Value *Val, int Off, int Len, int Pos)
196198
: Seg(Val, Off, Len), Pos(Pos) {}
197199
Block(const Block &Blk) = default;
200+
Block &operator=(const Block &Blk) = default;
198201
Segment Seg; // Value segment.
199202
int Pos; // Position (offset) of the segment in the Block.
200203
};

0 commit comments

Comments
 (0)