[llvm] 1842fe6 - Add missing GVN =operator. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 06:28:25 PST 2019


Author: Simon Pilgrim
Date: 2019-11-05T13:41:50Z
New Revision: 1842fe6be3c341642965233a9ec7c30da277f42b

URL: https://github.com/llvm/llvm-project/commit/1842fe6be3c341642965233a9ec7c30da277f42b
DIFF: https://github.com/llvm/llvm-project/commit/1842fe6be3c341642965233a9ec7c30da277f42b.diff

LOG: Add missing GVN =operator. NFCI.

Fixes PVS Studio warning that the 'ValueTable' class implements a copy constructor, but lacks the '=' operator.

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/Scalar/GVN.h
    llvm/lib/Transforms/Scalar/GVN.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/Scalar/GVN.h b/llvm/include/llvm/Transforms/Scalar/GVN.h
index 8a64768af6b5..67c23b9c0848 100644
--- a/llvm/include/llvm/Transforms/Scalar/GVN.h
+++ b/llvm/include/llvm/Transforms/Scalar/GVN.h
@@ -130,6 +130,7 @@ class GVN : public PassInfoMixin<GVN> {
     ValueTable(const ValueTable &Arg);
     ValueTable(ValueTable &&Arg);
     ~ValueTable();
+    ValueTable &operator=(const ValueTable &Arg);
 
     uint32_t lookupOrAdd(Value *V);
     uint32_t lookup(Value *V, bool Verify = true) const;

diff  --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 743353eaea22..097c548f6756 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -364,6 +364,7 @@ GVN::ValueTable::ValueTable() = default;
 GVN::ValueTable::ValueTable(const ValueTable &) = default;
 GVN::ValueTable::ValueTable(ValueTable &&) = default;
 GVN::ValueTable::~ValueTable() = default;
+GVN::ValueTable &GVN::ValueTable::operator=(const GVN::ValueTable &Arg) = default;
 
 /// add - Insert a value into the table with a specified value number.
 void GVN::ValueTable::add(Value *V, uint32_t num) {


        


More information about the llvm-commits mailing list