[CodeGen] Disable default copy assignment operator for struct VectorInfo
authorBing1 Yu <bing1.yu@intel.com>
Wed, 7 Jun 2023 06:32:36 +0000 (14:32 +0800)
committerBing1 Yu <bing1.yu@intel.com>
Wed, 7 Jun 2023 06:32:56 +0000 (14:32 +0800)
struct VectorInfo manages resources such as dynamically allocated memory, it's generally a good practice to either implement a custom copy constructor or disable the default one

Reviewed By: kazu

Differential Revision: https://reviews.llvm.org/D152230

llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp

index 4154cd8..d0ad6e4 100644 (file)
@@ -678,6 +678,8 @@ public:
     EI = new ElementInfo[VTy->getNumElements()];
   }
 
+  VectorInfo &operator=(const VectorInfo &other) = delete;
+
   virtual ~VectorInfo() { delete[] EI; }
 
   unsigned getDimension() const { return VTy->getNumElements(); }