diff options
author | Dávid Bolvanský <david.bolvansky@gmail.com> | 2019-11-23 23:08:22 +0100 |
---|---|---|
committer | Dávid Bolvanský <david.bolvansky@gmail.com> | 2019-11-23 23:09:39 +0100 |
commit | 745b6deaccf85cbaf9384433ca35798b0ae67df1 (patch) | |
tree | 614790059c6d2c6bda24a22fb02a65613982a1f0 /llvm/lib | |
parent | 1e0d395480b3cc4d1364aab74a81ce5ba29a470c (diff) | |
download | bcm5719-llvm-745b6deaccf85cbaf9384433ca35798b0ae67df1.tar.gz bcm5719-llvm-745b6deaccf85cbaf9384433ca35798b0ae67df1.zip |
Reland 'Fixed -Wdeprecated-copy warnings. NFCI.'
Fixed hashtable copy ctor.
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonGenInsert.cpp | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp b/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp index 3f759cdd57c..5b61d1084e0 100644 --- a/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp +++ b/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp @@ -134,11 +134,21 @@ namespace { uint32_t properties() const; unsigned size() const { return Size; } - LatticeCell &operator= (const LatticeCell &L) { + LatticeCell(const LatticeCell &L) { + // This memcpy also copies Properties (when L.Size == 0). + uint32_t N = + L.IsSpecial ? sizeof L.Properties : L.Size * sizeof(const Constant *); + memcpy(Values, L.Values, N); + Kind = L.Kind; + Size = L.Size; + IsSpecial = L.IsSpecial; + } + + LatticeCell &operator=(const LatticeCell &L) { if (this != &L) { // This memcpy also copies Properties (when L.Size == 0). uint32_t N = L.IsSpecial ? sizeof L.Properties - : L.Size*sizeof(const Constant*); + : L.Size * sizeof(const Constant *); memcpy(Values, L.Values, N); Kind = L.Kind; Size = L.Size; diff --git a/llvm/lib/Target/Hexagon/HexagonGenInsert.cpp b/llvm/lib/Target/Hexagon/HexagonGenInsert.cpp index 5a1d04c5797..2f29e88bc98 100644 --- a/llvm/lib/Target/Hexagon/HexagonGenInsert.cpp +++ b/llvm/lib/Target/Hexagon/HexagonGenInsert.cpp @@ -93,6 +93,10 @@ namespace { RegisterSet() = default; explicit RegisterSet(unsigned s, bool t = false) : BitVector(s, t) {} RegisterSet(const RegisterSet &RS) : BitVector(RS) {} + RegisterSet &operator=(const RegisterSet &RS) { + BitVector::operator=(RS); + return *this; + } using BitVector::clear; |