[llvm] 2b09c50 - [CodeGen] Disable default copy assignment operator for struct VectorInfo

Bing1 Yu via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 23:33:04 PDT 2023


Author: Bing1 Yu
Date: 2023-06-07T14:32:56+08:00
New Revision: 2b09c50f69b79470d19e3621c4f526b9d81af306

URL: https://github.com/llvm/llvm-project/commit/2b09c50f69b79470d19e3621c4f526b9d81af306
DIFF: https://github.com/llvm/llvm-project/commit/2b09c50f69b79470d19e3621c4f526b9d81af306.diff

LOG: [CodeGen] Disable default copy assignment operator for struct VectorInfo

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

Added: 
    

Modified: 
    llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp b/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
index 4154cd88e934a..d0ad6e45b4d3e 100644
--- a/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
+++ b/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
@@ -678,6 +678,8 @@ struct VectorInfo {
     EI = new ElementInfo[VTy->getNumElements()];
   }
 
+  VectorInfo &operator=(const VectorInfo &other) = delete;
+
   virtual ~VectorInfo() { delete[] EI; }
 
   unsigned getDimension() const { return VTy->getNumElements(); }


        


More information about the llvm-commits mailing list