[PATCH] D151543: [CGP] Disable default copy ctor and assignment operator for InstructionRemover InstructionRemover manages resources such as dynamically allocated memory, it's generally a good practice to either implement a custom copy constructor or disable the...

Bing Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 26 01:45:04 PDT 2023


yubing created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
yubing requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

...default one.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151543

Files:
  llvm/lib/CodeGen/CodeGenPrepare.cpp


Index: llvm/lib/CodeGen/CodeGenPrepare.cpp
===================================================================
--- llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -3062,6 +3062,9 @@
 
     ~InstructionRemover() override { delete Replacer; }
 
+    InstructionRemover &operator=(const InstructionRemover &other) = delete;
+    InstructionRemover(const InstructionRemover &other) = delete;
+
     /// Resurrect the instruction and reassign it to the proper uses if
     /// new value was provided when build this action.
     void undo() override {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151543.525979.patch
Type: text/x-patch
Size: 578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230526/de2f6c7b/attachment.bin>


More information about the llvm-commits mailing list