summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp')
-rw-r--r--llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp14
1 files changed, 12 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;
OpenPOWER on IntegriCloud