aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorBing1 Yu <bing1.yu@intel.com>2023-05-26 16:48:39 +0800
committerBing1 Yu <bing1.yu@intel.com>2023-05-27 23:20:33 +0800
commit1845d9de187b726dfe074218377c3d77ce43277a (patch)
tree89ea2bccb89cd43608f323acf194d1cbce8e6035 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parentf59795b2b703d5a782e4c29c0e786ee01942f16a (diff)
downloadllvm-1845d9de187b726dfe074218377c3d77ce43277a.zip
llvm-1845d9de187b726dfe074218377c3d77ce43277a.tar.gz
llvm-1845d9de187b726dfe074218377c3d77ce43277a.tar.bz2
[CGP] Disable default copy ctor and copy assignment operator for InstructionRemover
class InstructionRemover 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: pengfei Differential Revision: https://reviews.llvm.org/D151543
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index d806c7c..1f5a8d9 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -3062,6 +3062,9 @@ class TypePromotionTransaction {
~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 {