diff options
Diffstat (limited to 'llvm/lib/Target')
-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; |